Skip to content

Commit

Permalink
Fix proxy variables being broken
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 16, 2024
1 parent 6b91b36 commit 4df4d6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public BlockEntityActiveVariableBase(BlockEntityType<?> type, BlockPos blockPos,
}

public static <E> void registerActiveVariableBaseCapabilities(RegisterCapabilitiesEvent event, BlockEntityType<? extends BlockEntityActiveVariableBase<E>> blockEntityType) {
BlockEntityCableConnectableInventory.registerCableConnectableInventoryCapabilities(event, blockEntityType);

event.registerBlockEntity(
Capabilities.ValueInterface.BLOCK,
blockEntityType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ public void validate(INetwork network, IPartNetwork partNetwork, IValidator vali
targetVariable.get().getType()));
}

// Check if we are entering an infinite recursion (e.g. proxies refering to each other)
// Check if we are entering an infinite recursion (e.g. proxies referring to each other)
if(this.isValidatingVariable) {
throw new VariableRecursionException("Detected infinite recursion for variable references.");
}
this.isValidatingVariable = true;
getVariable(partNetwork);
getVariable(network, partNetwork);
this.isValidatingVariable = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueType;
import org.cyclops.integrateddynamics.api.evaluate.variable.IVariable;
import org.cyclops.integrateddynamics.api.item.IVariableFacade;
import org.cyclops.integrateddynamics.api.network.IPartNetwork;
import org.cyclops.integrateddynamics.core.persist.world.LabelsWorldStorage;

import java.util.List;
Expand Down Expand Up @@ -57,14 +53,4 @@ public void appendHoverText(List<Component> list, Level world) {
list.add(Component.translatable("item.integrateddynamics.variable.id", getId() == -1 ? "..." : getId()));
}

@Deprecated
public <V extends IValue> IVariable<V> getVariable(IPartNetwork network) {
throw new UnsupportedOperationException("This method has been deprecated");
}

@Deprecated
public void validate(IPartNetwork network, IValidator validator, IValueType containingValueType) {
throw new UnsupportedOperationException("This method has been deprecated");
}

}

0 comments on commit 4df4d6c

Please sign in to comment.