0.1.4
EnergonRelics/pipeline/head This commit looks good Details

pull/3/head 0.1.4+1.16.2
TheBrokenRail 3 years ago
parent 8241f88fea
commit 9e0edf763a

@ -1,5 +1,8 @@
# Changelog
**Beta 0.1.4**
* Fix Bug Where Off Switches Require Power
**Beta 0.1.3**
* Optimizations
* Fix Energy Teleporter Y Issues

@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
fabric_loader_version = 0.9.0+build.204
# Mod Properties
mod_version = 0.1.3
mod_version = 0.1.4
maven_group = com.thebrokenrail
# Dependencies

@ -6,6 +6,8 @@ import com.thebrokenrail.energonrelics.block.SwitchBlock;
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
import net.minecraft.block.entity.BlockEntityType;
import java.util.Objects;
public class SwitchBlockEntity extends EnergyReceiverBlockEntity {
public SwitchBlockEntity(BlockEntityType<?> type) {
super(type);
@ -13,7 +15,11 @@ public class SwitchBlockEntity extends EnergyReceiverBlockEntity {
@Override
protected void energyTick() {
addAction(Action.createBlockStatePropertyAction(HardcodedConfig.SWITCH_ENERGY_REQUIRED, SwitchBlock.POWERED, true, false));
if (getCachedState().get(SwitchBlock.ACTIVE)) {
addAction(Action.createBlockStatePropertyAction(HardcodedConfig.SWITCH_ENERGY_REQUIRED, SwitchBlock.POWERED, true, false));
} else if (getCachedState().get(SwitchBlock.POWERED)) {
Objects.requireNonNull(getWorld()).setBlockState(getPos(), getCachedState().with(SwitchBlock.POWERED, false));
}
}
@Override

Loading…
Cancel
Save