This commit is contained in:
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() {
|
||||
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
|
||||
|
Reference in New Issue
Block a user