mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 02:45:08 +00:00
refactor 6
This commit is contained in:
1 parent
5b62c4fdc8
commit
8d072f0c89
78 files changed
+525
-882
No files matched your search
@@ -54,6 +54,7 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
return fs != null || (player.isSneaking() && itemStack == null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFluidBuffer register() {
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileFluidBuffer.class, NameConst.BLOCK_FLUID_BUFFER);
|
||||
@@ -67,17 +68,8 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
return new RenderBlockFluidBuffer();
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
|
||||
@@ -23,6 +23,7 @@ public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
setTileEntity(TileFluidDiscretizer.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFluidDiscretizer register() {
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
GameRegistry.registerTileEntity(TileFluidDiscretizer.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
@@ -30,17 +31,8 @@ public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
|
||||
@@ -18,8 +18,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -57,7 +55,11 @@ public class BlockFluidInterface extends FCBaseBlock {
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
InventoryHandler.openGui(
|
||||
player, world, new BlockPos(x, y, z), EnumFacing.getFront(facing), GuiType.DUAL_INTERFACE);
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.DUAL_INTERFACE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -76,18 +78,11 @@ public class BlockFluidInterface extends FCBaseBlock {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFluidInterface register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_INTERFACE);
|
||||
GameRegistry.registerTileEntity(TileFluidInterface.class, NameConst.BLOCK_FLUID_INTERFACE);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,8 @@ import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
EnumFacing.getFront(facing),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.FLUID_PACKET_DECODER);
|
||||
}
|
||||
return true;
|
||||
@@ -49,6 +49,7 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFluidPacketDecoder register() {
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
GameRegistry.registerTileEntity(TileFluidPacketDecoder.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
@@ -56,17 +57,8 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
|
||||
@@ -10,9 +10,8 @@ import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFluidPatternEncoder extends FCBaseBlock {
|
||||
|
||||
@@ -36,7 +35,7 @@ public class BlockFluidPatternEncoder extends FCBaseBlock {
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
EnumFacing.getFront(facing),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.FLUID_PATTERN_ENCODER);
|
||||
}
|
||||
return true;
|
||||
@@ -44,18 +43,11 @@ public class BlockFluidPatternEncoder extends FCBaseBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFluidPatternEncoder register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_PATTERN_ENCODER);
|
||||
GameRegistry.registerTileEntity(TileFluidPatternEncoder.class, NameConst.BLOCK_FLUID_PATTERN_ENCODER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,8 @@ import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockIngredientBuffer extends FCBaseBlock {
|
||||
|
||||
@@ -34,25 +33,22 @@ public class BlockIngredientBuffer extends FCBaseBlock {
|
||||
if (tile != null) {
|
||||
if (!world.isRemote) {
|
||||
InventoryHandler.openGui(
|
||||
player, world, new BlockPos(x, y, z), EnumFacing.getFront(facing), GuiType.INGREDIENT_BUFFER);
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.INGREDIENT_BUFFER);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockIngredientBuffer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_INGREDIENT_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileIngredientBuffer.class, NameConst.BLOCK_INGREDIENT_BUFFER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,8 @@ import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
|
||||
@@ -37,7 +36,7 @@ public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
EnumFacing.getFront(facing),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.LARGE_INGREDIENT_BUFFER);
|
||||
}
|
||||
return true;
|
||||
@@ -45,18 +44,11 @@ public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockLargeIngredientBuffer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileLargeIngredientBuffer.class, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -22,8 +22,8 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
|
||||
@@ -34,6 +34,7 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
setTileEntity(TileLevelMaintainer.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockLevelMaintainer register() {
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_LEVEL_MAINTAINER);
|
||||
GameRegistry.registerTileEntity(TileLevelMaintainer.class, NameConst.BLOCK_LEVEL_MAINTAINER);
|
||||
@@ -61,7 +62,7 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
EnumFacing.getFront(facing),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.LEVEL_MAINTAINER);
|
||||
} else {
|
||||
player.addChatComponentMessage(new ChatComponentText("You don't have permission to view."));
|
||||
@@ -72,17 +73,8 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
|
||||
@@ -11,9 +11,8 @@ import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockOCPatternEditor extends FCBaseBlock {
|
||||
|
||||
@@ -34,13 +33,18 @@ public class BlockOCPatternEditor extends FCBaseBlock {
|
||||
if (tile != null) {
|
||||
if (!world.isRemote) {
|
||||
InventoryHandler.openGui(
|
||||
player, world, new BlockPos(x, y, z), EnumFacing.getFront(facing), GuiType.OC_PATTERN_EDITOR);
|
||||
player,
|
||||
world,
|
||||
new BlockPos(x, y, z),
|
||||
ForgeDirection.getOrientation(facing),
|
||||
GuiType.OC_PATTERN_EDITOR);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockOCPatternEditor register() {
|
||||
if (ModAndClassUtil.OC) {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_OC_PATTERN_EDITOR);
|
||||
@@ -50,12 +54,4 @@ public class BlockOCPatternEditor extends FCBaseBlock {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.glodblock.github.common.block;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
@@ -13,7 +14,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class FCBaseBlock extends AEBaseTileBlock {
|
||||
public abstract class FCBaseBlock extends AEBaseTileBlock implements IRegister<FCBaseBlock> {
|
||||
|
||||
public FCBaseBlock(Material mat, String name) {
|
||||
super(mat);
|
||||
@@ -39,7 +40,6 @@ public class FCBaseBlock extends AEBaseTileBlock {
|
||||
super.setFeature(f);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
@@ -47,7 +47,8 @@ public class FCBaseBlock extends AEBaseTileBlock {
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {}
|
||||
|
||||
protected final List listFormattedStringToWidth(String str) {
|
||||
@SuppressWarnings("unchecked")
|
||||
protected final List<String> listFormattedStringToWidth(String str) {
|
||||
return Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(str, 150);
|
||||
}
|
||||
|
||||
@@ -55,4 +56,12 @@ public class FCBaseBlock extends AEBaseTileBlock {
|
||||
ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips) {
|
||||
this.addInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user