Cleanup
This commit is contained in:
parent
1639fd63a3
commit
d0dedc6893
76 changed files with 44 additions and 743 deletions
|
@ -27,10 +27,7 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileAlloySmelter;
|
||||
|
||||
|
@ -38,7 +35,6 @@ public class BlockAlloySmelter extends BlockMachineBase {
|
|||
|
||||
public BlockAlloySmelter() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,10 +27,7 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileAssemblingMachine;
|
||||
|
||||
|
@ -38,7 +35,6 @@ public class BlockAssemblingMachine extends BlockMachineBase {
|
|||
|
||||
public BlockAssemblingMachine() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileAutoCraftingTable;
|
||||
|
||||
public class BlockAutoCraftingTable extends BlockMachineBase {
|
||||
|
||||
public BlockAutoCraftingTable() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileAutoCraftingTable();
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileCompressor;
|
||||
|
||||
public class BlockCompressor extends BlockMachineBase {
|
||||
|
||||
public BlockCompressor() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileCompressor();
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileElectricFurnace;
|
||||
|
||||
public class BlockElectricFurnace extends BlockMachineBase {
|
||||
|
||||
public BlockElectricFurnace() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileElectricFurnace();
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileExtractor;
|
||||
|
||||
public class BlockExtractor extends BlockMachineBase {
|
||||
|
||||
public BlockExtractor() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileExtractor();
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileGrinder;
|
||||
|
||||
public class BlockGrinder extends BlockMachineBase {
|
||||
|
||||
public BlockGrinder() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileGrinder();
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
package techreborn.blocks.tier1;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -37,7 +36,9 @@ import net.minecraft.entity.LivingEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateFactory;
|
||||
import net.minecraft.state.property.EnumProperty;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.StringIdentifiable;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -46,31 +47,19 @@ import net.minecraft.world.World;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.PropertyString;
|
||||
import reborncore.common.util.ArrayUtils;
|
||||
import reborncore.common.util.ChatUtils;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.tiles.machine.tier1.TilePlayerDectector;
|
||||
import techreborn.utils.MessageIDs;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockPlayerDetector extends BlockMachineBase {
|
||||
|
||||
public static final String[] types = new String[] { "all", "others", "you" };
|
||||
static List<String> typeNamesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
|
||||
public static PropertyString TYPE;
|
||||
public static EnumProperty<PlayerDetectorType> TYPE;
|
||||
|
||||
public BlockPlayerDetector() {
|
||||
super(Block.Settings.of(Material.METAL), true);
|
||||
this.setDefaultState(this.stateFactory.getDefaultState().with(TYPE, types[0]));
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, i, "machines/tier1_machines").setInvVariant("type=" + types[i]));
|
||||
}
|
||||
this.setDefaultState(this.stateFactory.getDefaultState().with(TYPE, PlayerDetectorType.ALL));
|
||||
}
|
||||
|
||||
// BlockMachineBase
|
||||
|
@ -98,8 +87,8 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
return super.activate(state, worldIn, pos, playerIn, hand, hitResult);
|
||||
}
|
||||
|
||||
String type = state.get(TYPE);
|
||||
String newType = type;
|
||||
PlayerDetectorType type = state.get(TYPE);
|
||||
PlayerDetectorType newType = type;
|
||||
Formatting color = Formatting.GREEN;
|
||||
|
||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||
|
@ -119,14 +108,14 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
return true;
|
||||
}
|
||||
} else {
|
||||
if (type.equals("all")) {
|
||||
newType = "others";
|
||||
if (type == PlayerDetectorType.ALL) {
|
||||
newType = PlayerDetectorType.OTHERS;
|
||||
color = Formatting.RED;
|
||||
} else if (type.equals("others")) {
|
||||
newType = "you";
|
||||
} else if (type == PlayerDetectorType.OTHERS) {
|
||||
newType = PlayerDetectorType.YOU;
|
||||
color = Formatting.BLUE;
|
||||
} else if (type.equals("you")) {
|
||||
newType = "all";
|
||||
} else if (type == PlayerDetectorType.YOU) {
|
||||
newType = PlayerDetectorType.ALL;
|
||||
}
|
||||
worldIn.setBlockState(pos, state.with(TYPE, newType));
|
||||
}
|
||||
|
@ -136,7 +125,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
if (worldIn.isClient) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.playerDetectorID, new LiteralText(
|
||||
Formatting.GRAY + I18n.translate("techreborn.message.detects") + " " + color
|
||||
+ StringUtils.toFirstCapital(newType)));
|
||||
+ StringUtils.toFirstCapital(newType.asString())));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -149,7 +138,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
// Block
|
||||
@Override
|
||||
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
|
||||
TYPE = new PropertyString("type", types);
|
||||
TYPE = EnumProperty.of("type", PlayerDetectorType.class);
|
||||
builder.add(TYPE);
|
||||
}
|
||||
|
||||
|
@ -175,4 +164,24 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public enum PlayerDetectorType implements StringIdentifiable {
|
||||
ALL("all"), OTHERS("others"), YOU("you");
|
||||
|
||||
private final String name;
|
||||
|
||||
private PlayerDetectorType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileRecycler;
|
||||
|
||||
public class BlockRecycler extends BlockMachineBase {
|
||||
|
||||
public BlockRecycler() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileRecycler();
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileRollingMachine;
|
||||
|
||||
public class BlockRollingMachine extends BlockMachineBase {
|
||||
|
||||
public BlockRollingMachine() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileRollingMachine();
|
||||
|
|
|
@ -27,20 +27,12 @@ package techreborn.blocks.tier1;
|
|||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.machine.tier1.TileScrapboxinator;
|
||||
|
||||
public class BlockScrapboxinator extends BlockMachineBase {
|
||||
|
||||
public BlockScrapboxinator() {
|
||||
super();
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView worldIn) {
|
||||
return new TileScrapboxinator();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue