0.1.4
EnergonRelics/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2020-08-19 20:48:29 -04:00
parent 8241f88fea
commit 9e0edf763a
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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