This commit is contained in:
parent
8241f88fea
commit
9e0edf763a
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**Beta 0.1.4**
|
||||||
|
* Fix Bug Where Off Switches Require Power
|
||||||
|
|
||||||
**Beta 0.1.3**
|
**Beta 0.1.3**
|
||||||
* Optimizations
|
* Optimizations
|
||||||
* Fix Energy Teleporter Y Issues
|
* Fix Energy Teleporter Y Issues
|
||||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.9.0+build.204
|
fabric_loader_version = 0.9.0+build.204
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 0.1.3
|
mod_version = 0.1.4
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
@ -6,6 +6,8 @@ import com.thebrokenrail.energonrelics.block.SwitchBlock;
|
|||||||
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
|
||||||
import net.minecraft.block.entity.BlockEntityType;
|
import net.minecraft.block.entity.BlockEntityType;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class SwitchBlockEntity extends EnergyReceiverBlockEntity {
|
public class SwitchBlockEntity extends EnergyReceiverBlockEntity {
|
||||||
public SwitchBlockEntity(BlockEntityType<?> type) {
|
public SwitchBlockEntity(BlockEntityType<?> type) {
|
||||||
super(type);
|
super(type);
|
||||||
@ -13,7 +15,11 @@ public class SwitchBlockEntity extends EnergyReceiverBlockEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void energyTick() {
|
protected void energyTick() {
|
||||||
|
if (getCachedState().get(SwitchBlock.ACTIVE)) {
|
||||||
addAction(Action.createBlockStatePropertyAction(HardcodedConfig.SWITCH_ENERGY_REQUIRED, SwitchBlock.POWERED, true, false));
|
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
|
@Override
|
||||||
|
Reference in New Issue
Block a user