Cleanup + remove some TODO's that dont apply anymore
This commit is contained in:
parent
6174506d6c
commit
6114f45d9b
10 changed files with 2 additions and 163 deletions
|
@ -124,8 +124,6 @@ public class CableBlockEntity extends BlockEntity
|
||||||
ticksSinceLastChange = 0;
|
ticksSinceLastChange = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO needs a full recode to not use a specific power net
|
|
||||||
|
|
||||||
ArrayList<EnergyBlockEntity> acceptors = new ArrayList<EnergyBlockEntity>();
|
ArrayList<EnergyBlockEntity> acceptors = new ArrayList<EnergyBlockEntity>();
|
||||||
for (Direction face : Direction.values()) {
|
for (Direction face : Direction.values()) {
|
||||||
BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
|
BlockEntity blockEntity = world.getBlockEntity(pos.offset(face));
|
||||||
|
|
|
@ -104,7 +104,6 @@ public class IronAlloyFurnaceBlockEntity extends MachineBaseBlockEntity
|
||||||
}
|
}
|
||||||
if (flag != this.burnTime > 0) {
|
if (flag != this.burnTime > 0) {
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
// TODO sync on/off
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
|
||||||
super(TRBlockEntities.INDUSTRIAL_SAWMILL, "IndustrialSawmill", TechRebornConfig.industrialSawmillMaxInput, TechRebornConfig.industrialSawmillMaxEnergy, TRContent.Machine.INDUSTRIAL_SAWMILL.block, 6);
|
super(TRBlockEntities.INDUSTRIAL_SAWMILL, "IndustrialSawmill", TechRebornConfig.industrialSawmillMaxInput, TechRebornConfig.industrialSawmillMaxEnergy, TRContent.Machine.INDUSTRIAL_SAWMILL.block, 6);
|
||||||
final int[] inputs = new int[] { 0, 1 };
|
final int[] inputs = new int[] { 0, 1 };
|
||||||
final int[] outputs = new int[] { 2, 3, 4 };
|
final int[] outputs = new int[] { 2, 3, 4 };
|
||||||
this.inventory = new RebornInventory<>(7, "SawmillBlockEntity", 64, this, getInventoryAccess());
|
this.inventory = new RebornInventory<>(7, "SawmillBlockEntity", 64, this);
|
||||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_SAWMILL, this, 1, 3, this.inventory, inputs, outputs);
|
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_SAWMILL, this, 1, 3, this.inventory, inputs, outputs);
|
||||||
this.tank = new Tank("SawmillBlockEntity", IndustrialSawmillBlockEntity.TANK_CAPACITY, this);
|
this.tank = new Tank("SawmillBlockEntity", IndustrialSawmillBlockEntity.TANK_CAPACITY, this);
|
||||||
this.ticksSinceLastChange = 0;
|
this.ticksSinceLastChange = 0;
|
||||||
|
@ -120,17 +120,6 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
|
||||||
return tank;
|
return tank;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IInventoryAccess<IndustrialSawmillBlockEntity> getInventoryAccess(){
|
|
||||||
return (slotID, stack, face, direction, blockEntity) -> {
|
|
||||||
if(direction == IInventoryAccess.AccessDirection.INSERT){
|
|
||||||
//TODO return if the stack can take fluids
|
|
||||||
//return stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null).isPresent();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// IContainerProvider
|
// IContainerProvider
|
||||||
@Override
|
@Override
|
||||||
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
public BuiltContainer createContainer(int syncID, final PlayerEntity player) {
|
||||||
|
|
|
@ -194,9 +194,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
||||||
ItemStack stack = inventory.getInvStack(j);
|
ItemStack stack = inventory.getInvStack(j);
|
||||||
if (ingredient.method_8093(stack)) {
|
if (ingredient.method_8093(stack)) {
|
||||||
handleContainerItem(stack);
|
handleContainerItem(stack);
|
||||||
stack.decrement(1); // TODO is this right? or do I need
|
stack.decrement(1);
|
||||||
// to use it as an actull
|
|
||||||
// crafting grid
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +205,6 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
||||||
if (output.isEmpty()) {
|
if (output.isEmpty()) {
|
||||||
inventory.setInvStack(9, outputStack.copy());
|
inventory.setInvStack(9, outputStack.copy());
|
||||||
} else {
|
} else {
|
||||||
// TODO use ouputStack in someway?
|
|
||||||
output.increment(recipe.getOutput().getCount());
|
output.increment(recipe.getOutput().getCount());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -116,7 +116,6 @@ public class TransformerBlockEntity extends PowerAcceptorBlockEntity
|
||||||
@Override
|
@Override
|
||||||
public void checkTier() {
|
public void checkTier() {
|
||||||
//Nope
|
//Nope
|
||||||
//TODO: really nope? needs review
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TileMachineBase
|
// TileMachineBase
|
||||||
|
|
|
@ -47,7 +47,6 @@ public enum EGui implements IMachineGuiHandler {
|
||||||
CHEMICAL_REACTOR,
|
CHEMICAL_REACTOR,
|
||||||
CHUNK_LOADER,
|
CHUNK_LOADER,
|
||||||
COMPRESSOR,
|
COMPRESSOR,
|
||||||
DESTRUCTOPACK(false),
|
|
||||||
DIESEL_GENERATOR,
|
DIESEL_GENERATOR,
|
||||||
DIGITAL_CHEST,
|
DIGITAL_CHEST,
|
||||||
DISTILLATION_TOWER,
|
DISTILLATION_TOWER,
|
||||||
|
|
|
@ -100,8 +100,6 @@ public class GuiHandler {
|
||||||
return new GuiChunkLoader(syncID, player, (ChunkLoaderBlockEntity) blockEntity);
|
return new GuiChunkLoader(syncID, player, (ChunkLoaderBlockEntity) blockEntity);
|
||||||
case COMPRESSOR:
|
case COMPRESSOR:
|
||||||
return new GuiCompressor(syncID, player, (CompressorBlockEntity) blockEntity);
|
return new GuiCompressor(syncID, player, (CompressorBlockEntity) blockEntity);
|
||||||
case DESTRUCTOPACK:
|
|
||||||
return new GuiDestructoPack(new ContainerDestructoPack(syncID, player));
|
|
||||||
case DIESEL_GENERATOR:
|
case DIESEL_GENERATOR:
|
||||||
return new GuiDieselGenerator(syncID, player, (DieselGeneratorBlockEntity) blockEntity);
|
return new GuiDieselGenerator(syncID, player, (DieselGeneratorBlockEntity) blockEntity);
|
||||||
case DIGITAL_CHEST:
|
case DIGITAL_CHEST:
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
|
||||||
*
|
|
||||||
* Copyright (c) 2018 TechReborn
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package techreborn.client.gui;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
|
|
||||||
import net.minecraft.client.resource.language.I18n;
|
|
||||||
import net.minecraft.container.Container;
|
|
||||||
import net.minecraft.text.LiteralText;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
public class GuiDestructoPack extends AbstractContainerScreen<Container> {
|
|
||||||
|
|
||||||
private static final Identifier texture = new Identifier("techreborn",
|
|
||||||
"textures/gui/destructopack.png");
|
|
||||||
|
|
||||||
public GuiDestructoPack(Container container) {
|
|
||||||
super(container, MinecraftClient.getInstance().player.inventory, new LiteralText("techreborn.destructopack"));
|
|
||||||
this.containerWidth = 176;
|
|
||||||
this.containerHeight = 166;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void drawBackground(float arg0, int arg1, int arg2) {
|
|
||||||
this.renderBackground();
|
|
||||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
this.minecraft.getTextureManager().bindTexture(texture);
|
|
||||||
blit(left, top, 0, 0, 176, 166);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void drawForeground(int arg0, int arg1) {
|
|
||||||
String name = I18n.translate("item.techreborn.destructopack");
|
|
||||||
font.draw(name, containerWidth / 2 - font.getStringWidth(name) / 2, 5, 4210752);
|
|
||||||
this.font.draw(I18n.translate("container.inventory"), 8, this.containerHeight - 96 + 2,
|
|
||||||
4210752);
|
|
||||||
super.drawForeground(arg0, arg1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
|
||||||
super.render(mouseX, mouseY, partialTicks);
|
|
||||||
this.drawMouseoverTooltip(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
|
||||||
*
|
|
||||||
* Copyright (c) 2018 TechReborn
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package techreborn.items;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.ActionResult;
|
|
||||||
import net.minecraft.util.Hand;
|
|
||||||
import net.minecraft.util.TypedActionResult;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import techreborn.TechReborn;
|
|
||||||
import techreborn.client.EGui;
|
|
||||||
|
|
||||||
public class ItemDestructopack extends Item {
|
|
||||||
|
|
||||||
public ItemDestructopack() {
|
|
||||||
super(new Item.Settings().group(TechReborn.ITEMGROUP));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TypedActionResult<ItemStack> use(final World world, final PlayerEntity player, final Hand hand) {
|
|
||||||
if (world.isClient) {
|
|
||||||
BlockPos pos = new BlockPos(player.x, player.y, player.z);
|
|
||||||
EGui.DESTRUCTOPACK.open(player, pos, world);
|
|
||||||
}
|
|
||||||
//TODO: Add server part
|
|
||||||
return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -51,7 +51,6 @@ public class ServerboundPackets {
|
||||||
public static final Identifier AUTO_CRAFTING_LOCK = new Identifier("techreborn", "auto_crafting_lock");
|
public static final Identifier AUTO_CRAFTING_LOCK = new Identifier("techreborn", "auto_crafting_lock");
|
||||||
public static final Identifier ROLLING_MACHINE_LOCK = new Identifier("techreborn", "rolling_machine_lock");
|
public static final Identifier ROLLING_MACHINE_LOCK = new Identifier("techreborn", "rolling_machine_lock");
|
||||||
public static final Identifier FUSION_CONTROL_SIZE = new Identifier("techreborn", "fusion_control_size");
|
public static final Identifier FUSION_CONTROL_SIZE = new Identifier("techreborn", "fusion_control_size");
|
||||||
public static final Identifier IDSU = new Identifier("techreborn", "idsu");
|
|
||||||
public static final Identifier REFUND = new Identifier("techreborn", "refund");
|
public static final Identifier REFUND = new Identifier("techreborn", "refund");
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
@ -93,18 +92,6 @@ public class ServerboundPackets {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
registerPacketHandler(IDSU, (extendedPacketBuffer, context) -> {
|
|
||||||
BlockPos pos = extendedPacketBuffer.readBlockPos();
|
|
||||||
int buttonID = extendedPacketBuffer.readInt();
|
|
||||||
|
|
||||||
context.getTaskQueue().execute(() -> {
|
|
||||||
//TODO was commented out when I ported it, so ill leave it here, needs looking into tho
|
|
||||||
// if (!pos.getWorld().isRemote) {
|
|
||||||
// pos.handleGuiInputFromClient(buttonID);
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
registerPacketHandler(ROLLING_MACHINE_LOCK, (extendedPacketBuffer, context) -> {
|
registerPacketHandler(ROLLING_MACHINE_LOCK, (extendedPacketBuffer, context) -> {
|
||||||
BlockPos machinePos = extendedPacketBuffer.readBlockPos();
|
BlockPos machinePos = extendedPacketBuffer.readBlockPos();
|
||||||
boolean locked = extendedPacketBuffer.readBoolean();
|
boolean locked = extendedPacketBuffer.readBoolean();
|
||||||
|
@ -164,12 +151,6 @@ public class ServerboundPackets {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Packet createPacketIdsu(int buttonID, InterdimensionalSUBlockEntity blockEntity) {
|
|
||||||
return NetworkManager.createServerBoundPacket(IDSU, extendedPacketBuffer -> {
|
|
||||||
extendedPacketBuffer.writeBlockPos(blockEntity.getPos());
|
|
||||||
extendedPacketBuffer.writeInt(buttonID);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Packet createPacketRollingMachineLock(RollingMachineBlockEntity machine, boolean locked) {
|
public static Packet createPacketRollingMachineLock(RollingMachineBlockEntity machine, boolean locked) {
|
||||||
return NetworkManager.createServerBoundPacket(ROLLING_MACHINE_LOCK, extendedPacketBuffer -> {
|
return NetworkManager.createServerBoundPacket(ROLLING_MACHINE_LOCK, extendedPacketBuffer -> {
|
||||||
|
|
Loading…
Reference in a new issue