Adressed PR comments
This commit is contained in:
@@ -12,7 +12,7 @@ import net.minecraft.world.World;
|
|||||||
public class CableNetworkNode extends NetworkNode implements ICoverable {
|
public class CableNetworkNode extends NetworkNode implements ICoverable {
|
||||||
public static final ResourceLocation ID = new ResourceLocation(RS.ID, "cable");
|
public static final ResourceLocation ID = new ResourceLocation(RS.ID, "cable");
|
||||||
|
|
||||||
private CoverManager coverManager;
|
private final CoverManager coverManager;
|
||||||
|
|
||||||
public CableNetworkNode(World world, BlockPos pos) {
|
public CableNetworkNode(World world, BlockPos pos) {
|
||||||
super(world, pos);
|
super(world, pos);
|
||||||
@@ -36,13 +36,15 @@ public class CableNetworkNode extends NetworkNode implements ICoverable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(CompoundNBT tag) {
|
public void read(CompoundNBT tag) {
|
||||||
if (tag.contains("Cover")) this.coverManager.readFromNbt(tag.getCompound("Cover"));
|
if (tag.contains(CoverManager.NBT_COVER_MANAGER)){
|
||||||
|
this.coverManager.readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
}
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundNBT write(CompoundNBT tag) {
|
public CompoundNBT write(CompoundNBT tag) {
|
||||||
tag.put("Cover", this.coverManager.writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||||
return super.write(tag);
|
return super.write(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
|
|||||||
private int type = IType.ITEMS;
|
private int type = IType.ITEMS;
|
||||||
private boolean drop = false;
|
private boolean drop = false;
|
||||||
|
|
||||||
private CoverManager coverManager;
|
private final CoverManager coverManager;
|
||||||
|
|
||||||
public ConstructorNetworkNode(World world, BlockPos pos) {
|
public ConstructorNetworkNode(World world, BlockPos pos) {
|
||||||
super(world, pos);
|
super(world, pos);
|
||||||
@@ -179,7 +179,9 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
|
|||||||
public void read(CompoundNBT tag) {
|
public void read(CompoundNBT tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
if (tag.contains("Cover")) this.coverManager.readFromNbt(tag.getCompound("Cover"));
|
if (tag.contains(CoverManager.NBT_COVER_MANAGER)){
|
||||||
|
this.coverManager.readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
}
|
||||||
|
|
||||||
StackUtils.readItems(upgrades, 1, tag);
|
StackUtils.readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
@@ -193,7 +195,7 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
|
|||||||
public CompoundNBT write(CompoundNBT tag) {
|
public CompoundNBT write(CompoundNBT tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
tag.put("Cover", this.coverManager.writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||||
|
|
||||||
StackUtils.writeItems(upgrades, 1, tag);
|
StackUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
|
|||||||
private boolean pickupItem = false;
|
private boolean pickupItem = false;
|
||||||
private ItemStack tool = createTool();
|
private ItemStack tool = createTool();
|
||||||
|
|
||||||
private CoverManager coverManager;
|
private final CoverManager coverManager;
|
||||||
|
|
||||||
public DestructorNetworkNode(World world, BlockPos pos) {
|
public DestructorNetworkNode(World world, BlockPos pos) {
|
||||||
super(world, pos);
|
super(world, pos);
|
||||||
@@ -255,7 +255,9 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
|
|||||||
public void read(CompoundNBT tag) {
|
public void read(CompoundNBT tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
if (tag.contains("Cover")) this.coverManager.readFromNbt(tag.getCompound("Cover"));
|
if (tag.contains(CoverManager.NBT_COVER_MANAGER)){
|
||||||
|
this.coverManager.readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
}
|
||||||
|
|
||||||
StackUtils.readItems(upgrades, 1, tag);
|
StackUtils.readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
@@ -269,7 +271,7 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
|
|||||||
public CompoundNBT write(CompoundNBT tag) {
|
public CompoundNBT write(CompoundNBT tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
tag.put("Cover", this.coverManager.writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||||
|
|
||||||
StackUtils.writeItems(upgrades, 1, tag);
|
StackUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
|
|||||||
|
|
||||||
private int filterSlot;
|
private int filterSlot;
|
||||||
|
|
||||||
private CoverManager coverManager;
|
private final CoverManager coverManager;
|
||||||
|
|
||||||
public ExporterNetworkNode(World world, BlockPos pos) {
|
public ExporterNetworkNode(World world, BlockPos pos) {
|
||||||
super(world, pos);
|
super(world, pos);
|
||||||
@@ -250,7 +250,7 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
|
|||||||
public CompoundNBT write(CompoundNBT tag) {
|
public CompoundNBT write(CompoundNBT tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
tag.put("Cover", this.coverManager.writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||||
|
|
||||||
StackUtils.writeItems(upgrades, 1, tag);
|
StackUtils.writeItems(upgrades, 1, tag);
|
||||||
return tag;
|
return tag;
|
||||||
@@ -274,7 +274,9 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
|
|||||||
public void read(CompoundNBT tag) {
|
public void read(CompoundNBT tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
if (tag.contains("Cover")) this.coverManager.readFromNbt(tag.getCompound("Cover"));
|
if (tag.contains(CoverManager.NBT_COVER_MANAGER)){
|
||||||
|
this.coverManager.readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
}
|
||||||
|
|
||||||
StackUtils.readItems(upgrades, 1, tag);
|
StackUtils.readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class ExternalStorageNetworkNode extends NetworkNode implements IStorageP
|
|||||||
private final List<IExternalStorage<ItemStack>> itemStorages = new CopyOnWriteArrayList<>();
|
private final List<IExternalStorage<ItemStack>> itemStorages = new CopyOnWriteArrayList<>();
|
||||||
private final List<IExternalStorage<FluidStack>> fluidStorages = new CopyOnWriteArrayList<>();
|
private final List<IExternalStorage<FluidStack>> fluidStorages = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
private CoverManager coverManager;
|
private final CoverManager coverManager;
|
||||||
|
|
||||||
public ExternalStorageNetworkNode(World world, BlockPos pos) {
|
public ExternalStorageNetworkNode(World world, BlockPos pos) {
|
||||||
super(world, pos);
|
super(world, pos);
|
||||||
@@ -334,7 +334,9 @@ public class ExternalStorageNetworkNode extends NetworkNode implements IStorageP
|
|||||||
public void read(CompoundNBT tag) {
|
public void read(CompoundNBT tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
if (tag.contains("Cover")) this.coverManager.readFromNbt(tag.getCompound("Cover"));
|
if (tag.contains(CoverManager.NBT_COVER_MANAGER)) {
|
||||||
|
this.coverManager.readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -343,7 +345,7 @@ public class ExternalStorageNetworkNode extends NetworkNode implements IStorageP
|
|||||||
public CompoundNBT write(CompoundNBT tag) {
|
public CompoundNBT write(CompoundNBT tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
tag.put("Cover", this.coverManager.writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
|
|||||||
|
|
||||||
private int currentSlot;
|
private int currentSlot;
|
||||||
|
|
||||||
private CoverManager coverManager;
|
private final CoverManager coverManager;
|
||||||
|
|
||||||
public ImporterNetworkNode(World world, BlockPos pos) {
|
public ImporterNetworkNode(World world, BlockPos pos) {
|
||||||
super(world, pos);
|
super(world, pos);
|
||||||
@@ -154,7 +154,9 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
|
|||||||
public void read(CompoundNBT tag) {
|
public void read(CompoundNBT tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
if (tag.contains("Cover")) this.coverManager.readFromNbt(tag.getCompound("Cover"));
|
if (tag.contains(CoverManager.NBT_COVER_MANAGER)) {
|
||||||
|
this.coverManager.readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
}
|
||||||
|
|
||||||
StackUtils.readItems(upgrades, 1, tag);
|
StackUtils.readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
@@ -168,7 +170,7 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
|
|||||||
public CompoundNBT write(CompoundNBT tag) {
|
public CompoundNBT write(CompoundNBT tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
tag.put("Cover", this.coverManager.writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||||
|
|
||||||
StackUtils.writeItems(upgrades, 1, tag);
|
StackUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class CoverManager {
|
public class CoverManager {
|
||||||
|
|
||||||
|
public static String NBT_COVER_MANAGER = "Cover";
|
||||||
|
|
||||||
public static final ModelProperty<CoverManager> PROPERTY = new ModelProperty<>();
|
public static final ModelProperty<CoverManager> PROPERTY = new ModelProperty<>();
|
||||||
|
|
||||||
private static final String NBT_DIRECTION = "Direction";
|
private static final String NBT_DIRECTION = "Direction";
|
||||||
@@ -149,7 +151,8 @@ public class CoverManager {
|
|||||||
|
|
||||||
BlockState state = getBlockState(item);
|
BlockState state = getBlockState(item);
|
||||||
|
|
||||||
return block != null && state != null && ((isModelSupported(state) && !block.ticksRandomly(state) && !block.hasTileEntity(state) && !state.isTransparent())); //Changed from 1.12: to use 1.16 methods
|
return block != null && state != null && isModelSupported(state) && !block.ticksRandomly(state)
|
||||||
|
&& !block.hasTileEntity(state) && !state.isTransparent(); //Changed from 1.12: to use 1.16 methods
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isModelSupported(BlockState state) {
|
private static boolean isModelSupported(BlockState state) {
|
||||||
@@ -184,11 +187,7 @@ public class CoverManager {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
return block.getDefaultState();
|
return block.getDefaultState();
|
||||||
} catch (Exception e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,14 +168,21 @@ public class CableBlock extends NetworkNodeBlock implements IWaterLoggable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent() && isSideNotCoveredOrHollow(tile, direction) && isSideNotCoveredOrHollow(world.getTileEntity(pos.offset(direction)), direction.getOpposite());
|
return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).isPresent()
|
||||||
|
&& isSideNotCoveredOrHollow(tile, direction)
|
||||||
|
&& isSideNotCoveredOrHollow(world.getTileEntity(pos.offset(direction)), direction.getOpposite());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSideNotCoveredOrHollow(TileEntity tile, Direction direction){
|
private boolean isSideNotCoveredOrHollow(TileEntity tile, Direction direction){
|
||||||
if (tile == null){
|
if (tile == null){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction).map(INetworkNodeProxy::getNode).map(iNetworkNode -> !(iNetworkNode instanceof ICoverable) || (!((ICoverable) iNetworkNode).getCoverManager().hasCover(direction) || ((ICoverable) iNetworkNode).getCoverManager().getCover(direction).getType() == CoverType.HOLLOW)).orElse(false);
|
return tile.getCapability(NetworkNodeProxyCapability.NETWORK_NODE_PROXY_CAPABILITY, direction)
|
||||||
|
.map(INetworkNodeProxy::getNode)
|
||||||
|
.map(iNetworkNode -> !(iNetworkNode instanceof ICoverable)
|
||||||
|
|| (!((ICoverable) iNetworkNode).getCoverManager().hasCover(direction)
|
||||||
|
|| ((ICoverable) iNetworkNode).getCoverManager().getCover(direction).getType() == CoverType.HOLLOW))
|
||||||
|
.orElse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlockState getState(BlockState currentState, IWorld world, BlockPos pos) {
|
private BlockState getState(BlockState currentState, IWorld world, BlockPos pos) {
|
||||||
|
|||||||
@@ -79,6 +79,5 @@ public class CoverCraftingCategoryExtension implements ICustomCraftingCategoryEx
|
|||||||
CoverItem.setItem(output, stack);
|
CoverItem.setItem(output, stack);
|
||||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, output);
|
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ public class HollowCoverCraftingCategoryExtension implements ICustomCraftingCate
|
|||||||
@Override
|
@Override
|
||||||
public void setRecipe(IRecipeLayout recipeLayout, IIngredients ingredients) {
|
public void setRecipe(IRecipeLayout recipeLayout, IIngredients ingredients) {
|
||||||
ItemStack stack = recipeLayout.getFocus(VanillaTypes.ITEM).getValue();
|
ItemStack stack = recipeLayout.getFocus(VanillaTypes.ITEM).getValue();
|
||||||
|
|
||||||
if (stack.getItem() == RSItems.COVER.get()){
|
if (stack.getItem() == RSItems.COVER.get()){
|
||||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, stack);
|
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, stack);
|
||||||
ItemStack output = new ItemStack(RSItems.HOLLOW_COVER.get());
|
ItemStack output = new ItemStack(RSItems.HOLLOW_COVER.get());
|
||||||
@@ -59,9 +58,7 @@ public class HollowCoverCraftingCategoryExtension implements ICustomCraftingCate
|
|||||||
ItemStack input = new ItemStack(RSItems.COVER.get());
|
ItemStack input = new ItemStack(RSItems.COVER.get());
|
||||||
CoverItem.setItem(input, CoverItem.getItem(stack));
|
CoverItem.setItem(input, CoverItem.getItem(stack));
|
||||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, input);
|
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, input);
|
||||||
|
|
||||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, stack);
|
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,13 +106,6 @@ public class BakedModelCover extends BakedModelCableCover{
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
|
|
||||||
// TRSRTransformation transform = RenderUtils.getDefaultBlockTransforms().get(cameraTransformType);
|
|
||||||
//
|
|
||||||
// return Pair.of(this, transform == null ? RenderUtils.EMPTY_MATRIX_TRANSFORM : transform.getMatrix());
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack matrixStack) {
|
public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack matrixStack) {
|
||||||
TransformationMatrix transform = RenderUtils.getDefaultBlockTransforms().get(cameraTransformType);
|
TransformationMatrix transform = RenderUtils.getDefaultBlockTransforms().get(cameraTransformType);
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ public class CubeBuilder {
|
|||||||
private BakedQuad bakeFace(Direction facing, Face cubeFace) {
|
private BakedQuad bakeFace(Direction facing, Face cubeFace) {
|
||||||
BakedQuadBuilder builder = new BakedQuadBuilder(cubeFace.sprite); //TODO See if can change the vertex format
|
BakedQuadBuilder builder = new BakedQuadBuilder(cubeFace.sprite); //TODO See if can change the vertex format
|
||||||
|
|
||||||
//builder.setTexture(cubeFace.sprite);
|
|
||||||
builder.setQuadOrientation(facing);
|
builder.setQuadOrientation(facing);
|
||||||
builder.setQuadTint(-1);
|
builder.setQuadTint(-1);
|
||||||
builder.setApplyDiffuseLighting(true);
|
builder.setApplyDiffuseLighting(true);
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ public class CableTile extends NetworkNodeTile<CableNetworkNode> {
|
|||||||
public static final TileDataParameter<CompoundNBT, CableTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
public static final TileDataParameter<CompoundNBT, CableTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
||||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
(initial, p) -> {});
|
||||||
|
|
||||||
static {
|
|
||||||
TileDataManager.registerParameter(COVER_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CableTile() {
|
public CableTile() {
|
||||||
super(RSTiles.CABLE);
|
super(RSTiles.CABLE);
|
||||||
@@ -59,7 +55,9 @@ public class CableTile extends NetworkNodeTile<CableNetworkNode> {
|
|||||||
@Override
|
@Override
|
||||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
|
||||||
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +65,7 @@ public class CableTile extends NetworkNodeTile<CableNetworkNode> {
|
|||||||
public void readUpdate(CompoundNBT tag) {
|
public void readUpdate(CompoundNBT tag) {
|
||||||
super.readUpdate(tag);
|
super.readUpdate(tag);
|
||||||
|
|
||||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
|
||||||
requestModelDataUpdate();
|
requestModelDataUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,7 @@ public class ConstructorTile extends NetworkNodeTile<ConstructorNetworkNode> {
|
|||||||
public static final TileDataParameter<CompoundNBT, ConstructorTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
public static final TileDataParameter<CompoundNBT, ConstructorTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
||||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
(initial, p) -> {});
|
||||||
|
|
||||||
static {
|
|
||||||
TileDataManager.registerParameter(COVER_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConstructorTile() {
|
public ConstructorTile() {
|
||||||
super(RSTiles.CONSTRUCTOR);
|
super(RSTiles.CONSTRUCTOR);
|
||||||
@@ -60,7 +56,7 @@ public class ConstructorTile extends NetworkNodeTile<ConstructorNetworkNode> {
|
|||||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
|
|
||||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -69,7 +65,7 @@ public class ConstructorTile extends NetworkNodeTile<ConstructorNetworkNode> {
|
|||||||
public void readUpdate(CompoundNBT tag) {
|
public void readUpdate(CompoundNBT tag) {
|
||||||
super.readUpdate(tag);
|
super.readUpdate(tag);
|
||||||
|
|
||||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
|
||||||
requestModelDataUpdate();
|
requestModelDataUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,7 @@ public class DestructorTile extends NetworkNodeTile<DestructorNetworkNode> {
|
|||||||
public static final TileDataParameter<CompoundNBT, DestructorTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
public static final TileDataParameter<CompoundNBT, DestructorTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
||||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
(initial, p) -> {});
|
||||||
|
|
||||||
static {
|
|
||||||
TileDataManager.registerParameter(COVER_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DestructorTile() {
|
public DestructorTile() {
|
||||||
super(RSTiles.DESTRUCTOR);
|
super(RSTiles.DESTRUCTOR);
|
||||||
@@ -63,7 +59,7 @@ public class DestructorTile extends NetworkNodeTile<DestructorNetworkNode> {
|
|||||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
|
|
||||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -72,7 +68,7 @@ public class DestructorTile extends NetworkNodeTile<DestructorNetworkNode> {
|
|||||||
public void readUpdate(CompoundNBT tag) {
|
public void readUpdate(CompoundNBT tag) {
|
||||||
super.readUpdate(tag);
|
super.readUpdate(tag);
|
||||||
|
|
||||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
|
||||||
requestModelDataUpdate();
|
requestModelDataUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -23,15 +23,11 @@ public class ExporterTile extends NetworkNodeTile<ExporterNetworkNode> {
|
|||||||
public static final TileDataParameter<CompoundNBT, ExporterTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
public static final TileDataParameter<CompoundNBT, ExporterTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
||||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
(initial, p) -> {});
|
||||||
|
|
||||||
public static final TileDataParameter<Integer, ExporterTile> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer, ExporterTile> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer, ExporterTile> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer, ExporterTile> TYPE = IType.createParameter();
|
||||||
|
|
||||||
static {
|
|
||||||
TileDataManager.registerParameter(COVER_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExporterTile() {
|
public ExporterTile() {
|
||||||
super(RSTiles.EXPORTER);
|
super(RSTiles.EXPORTER);
|
||||||
|
|
||||||
@@ -55,7 +51,8 @@ public class ExporterTile extends NetworkNodeTile<ExporterNetworkNode> {
|
|||||||
@Override
|
@Override
|
||||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
|
||||||
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -64,7 +61,7 @@ public class ExporterTile extends NetworkNodeTile<ExporterNetworkNode> {
|
|||||||
public void readUpdate(CompoundNBT tag) {
|
public void readUpdate(CompoundNBT tag) {
|
||||||
super.readUpdate(tag);
|
super.readUpdate(tag);
|
||||||
|
|
||||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
|
||||||
requestModelDataUpdate();
|
requestModelDataUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -58,11 +58,7 @@ public class ExternalStorageTile extends NetworkNodeTile<ExternalStorageNetworkN
|
|||||||
public static final TileDataParameter<CompoundNBT, ExternalStorageTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
public static final TileDataParameter<CompoundNBT, ExternalStorageTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
||||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
(initial, p) -> {});
|
||||||
|
|
||||||
static {
|
|
||||||
TileDataManager.registerParameter(COVER_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExternalStorageTile() {
|
public ExternalStorageTile() {
|
||||||
super(RSTiles.EXTERNAL_STORAGE);
|
super(RSTiles.EXTERNAL_STORAGE);
|
||||||
@@ -93,7 +89,7 @@ public class ExternalStorageTile extends NetworkNodeTile<ExternalStorageNetworkN
|
|||||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
|
|
||||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -102,7 +98,7 @@ public class ExternalStorageTile extends NetworkNodeTile<ExternalStorageNetworkN
|
|||||||
public void readUpdate(CompoundNBT tag) {
|
public void readUpdate(CompoundNBT tag) {
|
||||||
super.readUpdate(tag);
|
super.readUpdate(tag);
|
||||||
|
|
||||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
|
||||||
requestModelDataUpdate();
|
requestModelDataUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,7 @@ public class ImporterTile extends NetworkNodeTile<ImporterNetworkNode> {
|
|||||||
public static final TileDataParameter<CompoundNBT, ImporterTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
public static final TileDataParameter<CompoundNBT, ImporterTile> COVER_MANAGER = new TileDataParameter<>(DataSerializers.COMPOUND_NBT, new CompoundNBT(),
|
||||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
(initial, p) -> {});
|
||||||
|
|
||||||
static {
|
|
||||||
TileDataManager.registerParameter(COVER_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ImporterTile() {
|
public ImporterTile() {
|
||||||
super(RSTiles.IMPORTER);
|
super(RSTiles.IMPORTER);
|
||||||
@@ -58,7 +54,7 @@ public class ImporterTile extends NetworkNodeTile<ImporterNetworkNode> {
|
|||||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
|
|
||||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -67,7 +63,7 @@ public class ImporterTile extends NetworkNodeTile<ImporterNetworkNode> {
|
|||||||
public void readUpdate(CompoundNBT tag) {
|
public void readUpdate(CompoundNBT tag) {
|
||||||
super.readUpdate(tag);
|
super.readUpdate(tag);
|
||||||
|
|
||||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||||
|
|
||||||
requestModelDataUpdate();
|
requestModelDataUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
|||||||
import net.minecraftforge.client.event.RenderTooltipEvent;
|
import net.minecraftforge.client.event.RenderTooltipEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fml.ModList;
|
||||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@@ -317,7 +318,7 @@ public final class RenderUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isLightMapDisabled() {
|
public static boolean isLightMapDisabled() {
|
||||||
return false; //FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled; TODO
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VertexFormat getFormatWithLightMap(VertexFormat format) {
|
public static VertexFormat getFormatWithLightMap(VertexFormat format) {
|
||||||
|
|||||||
Reference in New Issue
Block a user