This commit is contained in:
parent
9096dbd53a
commit
dfe547c34b
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**Beta 0.0.9**
|
||||
* Fix Interaction Bug With Phase Shifter Block
|
||||
|
||||
**Beta 0.0.8**
|
||||
* Add Phase Shifter Block
|
||||
* Fix Bugs
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.9.0+build.204
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.0.8
|
||||
mod_version = 0.0.9
|
||||
maven_group = com.thebrokenrail
|
||||
|
||||
# Dependencies
|
||||
|
@ -14,13 +14,17 @@ public interface EnergyTickable {
|
||||
*/
|
||||
@ApiStatus.OverrideOnly
|
||||
List<EnergyTickable> startTick();
|
||||
|
||||
/**
|
||||
* Logic Tick
|
||||
*/
|
||||
@ApiStatus.OverrideOnly
|
||||
void logicTick();
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
*
|
||||
* Used By The Debug Profiler
|
||||
* @return ID
|
||||
*/
|
||||
@ApiStatus.OverrideOnly
|
||||
|
@ -17,11 +17,17 @@ import java.util.Objects;
|
||||
@ApiStatus.Internal
|
||||
public class EnergyTicker {
|
||||
private static final List<EnergyTickable> scheduled = new ArrayList<>();
|
||||
private static List<EnergyTickable> allLoaded = Collections.emptyList();
|
||||
|
||||
/**
|
||||
* List of All Loaded Energy Tickers
|
||||
* Get All Loaded Energy Tickers
|
||||
*
|
||||
* Only Usable In {@link EnergyTickable#logicTick()}
|
||||
* @return List Of All Loaded Energy Tickers
|
||||
*/
|
||||
public static List<EnergyTickable> allLoaded = Collections.emptyList();
|
||||
public static List<EnergyTickable> getAllLoaded() {
|
||||
return allLoaded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule For Next Energy Tick
|
||||
|
@ -3,7 +3,7 @@ package com.thebrokenrail.energonrelics.api.item;
|
||||
import net.minecraft.text.MutableText;
|
||||
|
||||
/**
|
||||
* Implement To provide Extra Information In Multimeter
|
||||
* Implement To Provide Extra Information In Multimeter
|
||||
*/
|
||||
public interface MultimeterExtra {
|
||||
/**
|
||||
|
@ -82,10 +82,14 @@ public class PhaseShifterBlock extends EnergyBlock {
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
|
||||
ActionResult result = super.onUse(state, world, pos, player, hand, hit);
|
||||
if (result != ActionResult.PASS) {
|
||||
return result;
|
||||
} else {
|
||||
ItemStack stack = player.getStackInHand(hand);
|
||||
BlockEntity entity = world.getBlockEntity(pos);
|
||||
|
||||
if (stack.getItem() instanceof DyeItem) {
|
||||
if (stack.getItem() instanceof DyeItem && player.shouldCancelInteraction()) {
|
||||
DyeColor newColor = ((DyeItem) stack.getItem()).getColor();
|
||||
if (state.get(COLOR) != newColor) {
|
||||
world.setBlockState(pos, state.with(COLOR, newColor));
|
||||
@ -107,6 +111,7 @@ public class PhaseShifterBlock extends EnergyBlock {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasInventory() {
|
||||
|
@ -161,7 +161,7 @@ public class PhaseShifterBlockEntity extends EnergyReceiverBlockEntity implement
|
||||
|
||||
if (getCachedState().get(PhaseShifterBlock.POWERED) && !getCachedState().get(PhaseShifterBlock.IS_OUTPUT)) {
|
||||
List<PhaseShifterBlockEntity> outputs = new ArrayList<>();
|
||||
for (EnergyTickable tickable : EnergyTicker.allLoaded) {
|
||||
for (EnergyTickable tickable : EnergyTicker.getAllLoaded()) {
|
||||
if (tickable instanceof PhaseShifterBlockEntity && ((PhaseShifterBlockEntity) tickable).getCachedState().get(PhaseShifterBlock.IS_OUTPUT) && Objects.requireNonNull(((PhaseShifterBlockEntity) tickable).getWorld()).getRegistryKey() == getWorld().getRegistryKey() && ((PhaseShifterBlockEntity) tickable).cooldown == 0 && ((PhaseShifterBlockEntity) tickable).getCachedState().get(PhaseShifterBlock.COLOR) == getCachedState().get(PhaseShifterBlock.COLOR)) {
|
||||
outputs.add((PhaseShifterBlockEntity) tickable);
|
||||
}
|
||||
|
Reference in New Issue
Block a user