Fix problem with classloading. Fixes #2008
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.gui;
|
||||||
|
|
||||||
|
import com.raoulvdberge.refinedstorage.gui.control.SideButtonCrafterMode;
|
||||||
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameterClientListener;
|
||||||
|
|
||||||
|
public class TileDataParameterClientListenerCrafter implements TileDataParameterClientListener<Boolean> {
|
||||||
|
@Override
|
||||||
|
public void onChanged(boolean initial, Boolean hasRoot) {
|
||||||
|
if (!hasRoot) {
|
||||||
|
GuiBase.executeLater(GuiCrafter.class, gui -> {
|
||||||
|
gui.addSideButton(new SideButtonCrafterMode(gui));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.raoulvdberge.refinedstorage.tile;
|
package com.raoulvdberge.refinedstorage.tile;
|
||||||
|
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeCrafter;
|
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeCrafter;
|
||||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
import com.raoulvdberge.refinedstorage.gui.TileDataParameterClientListenerCrafter;
|
||||||
import com.raoulvdberge.refinedstorage.gui.GuiCrafter;
|
|
||||||
import com.raoulvdberge.refinedstorage.gui.control.SideButtonCrafterMode;
|
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
||||||
import net.minecraft.network.datasync.DataSerializers;
|
import net.minecraft.network.datasync.DataSerializers;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
@@ -18,13 +16,7 @@ import javax.annotation.Nullable;
|
|||||||
public class TileCrafter extends TileNode<NetworkNodeCrafter> {
|
public class TileCrafter extends TileNode<NetworkNodeCrafter> {
|
||||||
public static final TileDataParameter<String, TileCrafter> NAME = new TileDataParameter<>(DataSerializers.STRING, NetworkNodeCrafter.DEFAULT_NAME, t -> t.getNode().getName());
|
public static final TileDataParameter<String, TileCrafter> NAME = new TileDataParameter<>(DataSerializers.STRING, NetworkNodeCrafter.DEFAULT_NAME, t -> t.getNode().getName());
|
||||||
public static final TileDataParameter<Integer, TileCrafter> MODE = new TileDataParameter<>(DataSerializers.VARINT, NetworkNodeCrafter.CrafterMode.IGNORE.ordinal(), t -> t.getNode().getMode().ordinal(), (t, v) -> t.getNode().setMode(NetworkNodeCrafter.CrafterMode.getById(v)));
|
public static final TileDataParameter<Integer, TileCrafter> MODE = new TileDataParameter<>(DataSerializers.VARINT, NetworkNodeCrafter.CrafterMode.IGNORE.ordinal(), t -> t.getNode().getMode().ordinal(), (t, v) -> t.getNode().setMode(NetworkNodeCrafter.CrafterMode.getById(v)));
|
||||||
public static final TileDataParameter<Boolean, TileCrafter> HAS_ROOT = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().getRootContainerNotSelf().isPresent(), null, (t, hasRoot) -> {
|
private static final TileDataParameter<Boolean, TileCrafter> HAS_ROOT = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().getRootContainerNotSelf().isPresent(), null, (t, v) -> new TileDataParameterClientListenerCrafter().onChanged(t, v));
|
||||||
if (!hasRoot) {
|
|
||||||
GuiBase.executeLater(GuiCrafter.class, gui -> {
|
|
||||||
gui.addSideButton(new SideButtonCrafterMode(gui));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
public TileCrafter() {
|
public TileCrafter() {
|
||||||
dataManager.addWatchedParameter(NAME);
|
dataManager.addWatchedParameter(NAME);
|
||||||
|
|||||||
Reference in New Issue
Block a user