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 static final ResourceLocation ID = new ResourceLocation(RS.ID, "cable");
|
||||
|
||||
private CoverManager coverManager;
|
||||
private final CoverManager coverManager;
|
||||
|
||||
public CableNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
@@ -36,13 +36,15 @@ public class CableNetworkNode extends NetworkNode implements ICoverable {
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT tag) {
|
||||
tag.put("Cover", this.coverManager.writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||
return super.write(tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
|
||||
private int type = IType.ITEMS;
|
||||
private boolean drop = false;
|
||||
|
||||
private CoverManager coverManager;
|
||||
private final CoverManager coverManager;
|
||||
|
||||
public ConstructorNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
@@ -179,7 +179,9 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
|
||||
public void read(CompoundNBT 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);
|
||||
}
|
||||
@@ -193,7 +195,7 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
|
||||
public CompoundNBT write(CompoundNBT tag) {
|
||||
super.write(tag);
|
||||
|
||||
tag.put("Cover", this.coverManager.writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||
|
||||
StackUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
|
||||
private boolean pickupItem = false;
|
||||
private ItemStack tool = createTool();
|
||||
|
||||
private CoverManager coverManager;
|
||||
private final CoverManager coverManager;
|
||||
|
||||
public DestructorNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
@@ -255,7 +255,9 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
|
||||
public void read(CompoundNBT 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);
|
||||
}
|
||||
@@ -269,7 +271,7 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
|
||||
public CompoundNBT write(CompoundNBT tag) {
|
||||
super.write(tag);
|
||||
|
||||
tag.put("Cover", this.coverManager.writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||
|
||||
StackUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
|
||||
|
||||
private int filterSlot;
|
||||
|
||||
private CoverManager coverManager;
|
||||
private final CoverManager coverManager;
|
||||
|
||||
public ExporterNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
@@ -250,7 +250,7 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
|
||||
public CompoundNBT write(CompoundNBT tag) {
|
||||
super.write(tag);
|
||||
|
||||
tag.put("Cover", this.coverManager.writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||
|
||||
StackUtils.writeItems(upgrades, 1, tag);
|
||||
return tag;
|
||||
@@ -274,7 +274,9 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
|
||||
public void read(CompoundNBT 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);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ExternalStorageNetworkNode extends NetworkNode implements IStorageP
|
||||
private final List<IExternalStorage<ItemStack>> itemStorages = new CopyOnWriteArrayList<>();
|
||||
private final List<IExternalStorage<FluidStack>> fluidStorages = new CopyOnWriteArrayList<>();
|
||||
|
||||
private CoverManager coverManager;
|
||||
private final CoverManager coverManager;
|
||||
|
||||
public ExternalStorageNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
@@ -334,7 +334,9 @@ public class ExternalStorageNetworkNode extends NetworkNode implements IStorageP
|
||||
public void read(CompoundNBT 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) {
|
||||
super.write(tag);
|
||||
|
||||
tag.put("Cover", this.coverManager.writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
|
||||
|
||||
private int currentSlot;
|
||||
|
||||
private CoverManager coverManager;
|
||||
private final CoverManager coverManager;
|
||||
|
||||
public ImporterNetworkNode(World world, BlockPos pos) {
|
||||
super(world, pos);
|
||||
@@ -154,7 +154,9 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
|
||||
public void read(CompoundNBT 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);
|
||||
}
|
||||
@@ -168,7 +170,7 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
|
||||
public CompoundNBT write(CompoundNBT tag) {
|
||||
super.write(tag);
|
||||
|
||||
tag.put("Cover", this.coverManager.writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.coverManager.writeToNbt());
|
||||
|
||||
StackUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ import java.util.Map;
|
||||
|
||||
public class CoverManager {
|
||||
|
||||
public static String NBT_COVER_MANAGER = "Cover";
|
||||
|
||||
public static final ModelProperty<CoverManager> PROPERTY = new ModelProperty<>();
|
||||
|
||||
private static final String NBT_DIRECTION = "Direction";
|
||||
@@ -149,7 +151,8 @@ public class CoverManager {
|
||||
|
||||
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) {
|
||||
@@ -184,11 +187,7 @@ public class CoverManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return block.getDefaultState();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
return block.getDefaultState();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -168,14 +168,21 @@ public class CableBlock extends NetworkNodeBlock implements IWaterLoggable {
|
||||
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){
|
||||
if (tile == null){
|
||||
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) {
|
||||
|
||||
@@ -72,13 +72,12 @@ public class CoverCraftingCategoryExtension implements ICustomCraftingCategoryEx
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(4, Tags.Items.NUGGETS_IRON.getAllElements().stream().map(ItemStack::new).collect(Collectors.toList()));
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, CoverItem.getItem(stack));
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, stack);
|
||||
}else {
|
||||
} else {
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(4, Tags.Items.NUGGETS_IRON.getAllElements().stream().map(ItemStack::new).collect(Collectors.toList()));
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, stack);
|
||||
ItemStack output = new ItemStack(RSItems.COVER.get());
|
||||
CoverItem.setItem(output, stack);
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, output);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,19 +49,16 @@ public class HollowCoverCraftingCategoryExtension implements ICustomCraftingCate
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IIngredients ingredients) {
|
||||
ItemStack stack = recipeLayout.getFocus(VanillaTypes.ITEM).getValue();
|
||||
|
||||
if (stack.getItem() == RSItems.COVER.get()){
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, stack);
|
||||
ItemStack output = new ItemStack(RSItems.HOLLOW_COVER.get());
|
||||
CoverItem.setItem(output, CoverItem.getItem(stack));
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, output);
|
||||
}else {
|
||||
} else {
|
||||
ItemStack input = new ItemStack(RSItems.COVER.get());
|
||||
CoverItem.setItem(input, CoverItem.getItem(stack));
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(5, input);
|
||||
|
||||
recipeLayout.getIngredientsGroup(VanillaTypes.ITEM).set(0, stack);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,15 +76,15 @@ public class ConstantsCable {
|
||||
}
|
||||
|
||||
public static VoxelShape addCoverVoxelShapes(VoxelShape shape, IBlockReader world, BlockPos pos){
|
||||
if (world != null){
|
||||
if (world != null) {
|
||||
TileEntity entity = world.getTileEntity(pos);
|
||||
if (entity instanceof NetworkNodeTile && ((NetworkNodeTile<?>) entity).getNode() instanceof ICoverable){
|
||||
if (entity instanceof NetworkNodeTile && ((NetworkNodeTile<?>) entity).getNode() instanceof ICoverable) {
|
||||
CoverManager coverManager = ((ICoverable) ((NetworkNodeTile<?>) entity).getNode()).getCoverManager();
|
||||
for (Direction value : Direction.values()) {
|
||||
Cover cover = coverManager.getCover(value);
|
||||
if (cover != null){
|
||||
if (cover != null) {
|
||||
shape = VoxelShapes.or(shape, VoxelShapes.create(ConstantsCable.getCoverBounds(value)));
|
||||
if (cover.getType() == CoverType.NORMAL){
|
||||
if (cover.getType() == CoverType.NORMAL) {
|
||||
shape = VoxelShapes.or(shape, VoxelShapes.create(ConstantsCable.getHolderBounds(value)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack matrixStack) {
|
||||
TransformationMatrix transform = RenderUtils.getDefaultBlockTransforms().get(cameraTransformType);
|
||||
|
||||
@@ -113,7 +113,6 @@ public class CubeBuilder {
|
||||
private BakedQuad bakeFace(Direction facing, Face cubeFace) {
|
||||
BakedQuadBuilder builder = new BakedQuadBuilder(cubeFace.sprite); //TODO See if can change the vertex format
|
||||
|
||||
//builder.setTexture(cubeFace.sprite);
|
||||
builder.setQuadOrientation(facing);
|
||||
builder.setQuadTint(-1);
|
||||
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(),
|
||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
||||
|
||||
static {
|
||||
TileDataManager.registerParameter(COVER_MANAGER);
|
||||
}
|
||||
(initial, p) -> {});
|
||||
|
||||
public CableTile() {
|
||||
super(RSTiles.CABLE);
|
||||
@@ -59,7 +55,9 @@ public class CableTile extends NetworkNodeTile<CableNetworkNode> {
|
||||
@Override
|
||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||
super.writeUpdate(tag);
|
||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@@ -67,7 +65,7 @@ public class CableTile extends NetworkNodeTile<CableNetworkNode> {
|
||||
public void readUpdate(CompoundNBT tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||
|
||||
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(),
|
||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
||||
|
||||
static {
|
||||
TileDataManager.registerParameter(COVER_MANAGER);
|
||||
}
|
||||
(initial, p) -> {});
|
||||
|
||||
public ConstructorTile() {
|
||||
super(RSTiles.CONSTRUCTOR);
|
||||
@@ -60,7 +56,7 @@ public class ConstructorTile extends NetworkNodeTile<ConstructorNetworkNode> {
|
||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
@@ -69,7 +65,7 @@ public class ConstructorTile extends NetworkNodeTile<ConstructorNetworkNode> {
|
||||
public void readUpdate(CompoundNBT tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||
|
||||
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(),
|
||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
||||
|
||||
static {
|
||||
TileDataManager.registerParameter(COVER_MANAGER);
|
||||
}
|
||||
(initial, p) -> {});
|
||||
|
||||
public DestructorTile() {
|
||||
super(RSTiles.DESTRUCTOR);
|
||||
@@ -63,7 +59,7 @@ public class DestructorTile extends NetworkNodeTile<DestructorNetworkNode> {
|
||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
@@ -72,7 +68,7 @@ public class DestructorTile extends NetworkNodeTile<DestructorNetworkNode> {
|
||||
public void readUpdate(CompoundNBT tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||
|
||||
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(),
|
||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||
(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> TYPE = IType.createParameter();
|
||||
|
||||
static {
|
||||
TileDataManager.registerParameter(COVER_MANAGER);
|
||||
}
|
||||
|
||||
public ExporterTile() {
|
||||
super(RSTiles.EXPORTER);
|
||||
|
||||
@@ -55,7 +51,8 @@ public class ExporterTile extends NetworkNodeTile<ExporterNetworkNode> {
|
||||
@Override
|
||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||
super.writeUpdate(tag);
|
||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
@@ -64,7 +61,7 @@ public class ExporterTile extends NetworkNodeTile<ExporterNetworkNode> {
|
||||
public void readUpdate(CompoundNBT tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||
|
||||
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(),
|
||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
||||
|
||||
static {
|
||||
TileDataManager.registerParameter(COVER_MANAGER);
|
||||
}
|
||||
(initial, p) -> {});
|
||||
|
||||
public ExternalStorageTile() {
|
||||
super(RSTiles.EXTERNAL_STORAGE);
|
||||
@@ -93,7 +89,7 @@ public class ExternalStorageTile extends NetworkNodeTile<ExternalStorageNetworkN
|
||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
@@ -102,7 +98,7 @@ public class ExternalStorageTile extends NetworkNodeTile<ExternalStorageNetworkN
|
||||
public void readUpdate(CompoundNBT tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||
|
||||
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(),
|
||||
t -> t.getNode().getCoverManager().writeToNbt(),
|
||||
(t, v) -> t.getNode().getCoverManager().readFromNbt(v),
|
||||
(initial, p) -> Minecraft.getInstance().enqueue(() -> {}));
|
||||
|
||||
static {
|
||||
TileDataManager.registerParameter(COVER_MANAGER);
|
||||
}
|
||||
(initial, p) -> {});
|
||||
|
||||
public ImporterTile() {
|
||||
super(RSTiles.IMPORTER);
|
||||
@@ -58,7 +54,7 @@ public class ImporterTile extends NetworkNodeTile<ImporterNetworkNode> {
|
||||
public CompoundNBT writeUpdate(CompoundNBT tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.put("Covers", this.getNode().getCoverManager().writeToNbt());
|
||||
tag.put(CoverManager.NBT_COVER_MANAGER, this.getNode().getCoverManager().writeToNbt());
|
||||
|
||||
return tag;
|
||||
}
|
||||
@@ -67,7 +63,7 @@ public class ImporterTile extends NetworkNodeTile<ImporterNetworkNode> {
|
||||
public void readUpdate(CompoundNBT tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound("Covers"));
|
||||
this.getNode().getCoverManager().readFromNbt(tag.getCompound(CoverManager.NBT_COVER_MANAGER));
|
||||
|
||||
requestModelDataUpdate();
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.event.RenderTooltipEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -317,7 +318,7 @@ public final class RenderUtils {
|
||||
}
|
||||
|
||||
public static boolean isLightMapDisabled() {
|
||||
return false; //FMLClientHandler.instance().hasOptifine() || !ForgeModContainer.forgeLightPipelineEnabled; TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
public static VertexFormat getFormatWithLightMap(VertexFormat format) {
|
||||
|
||||
Reference in New Issue
Block a user