mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 19:15:24 +00:00
Generics for everyone \o/
This commit is contained in:
1 parent
ac9344cbda
commit
23ed2dcaea
55 files changed
+164
-163
No files matched your search
@@ -8,7 +8,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IFlowerType<I extends IFlowerType> extends Comparable<I> {
|
||||
public interface IFlowerType<I extends IFlowerType<I>> extends Comparable<I> {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumFlowerStage type);
|
||||
|
||||
@@ -54,9 +54,9 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicBrickPair>, IColoredBlock, ISpriteRegister, IStateMapperRegister, IItemModelRegister {
|
||||
|
||||
|
||||
public static final PropertyEnum<CeramicBrickType> TYPE = PropertyEnum.create("type", CeramicBrickType.class);
|
||||
|
||||
|
||||
public BlockCeramicBrick() {
|
||||
super(Material.ROCK);
|
||||
this.setHardness(1.0f);
|
||||
@@ -85,7 +85,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
return new TileCeramicBrick();
|
||||
@@ -111,7 +111,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
itemList.add(new CeramicBrickPair(EnumFlowerColor.Brown, EnumFlowerColor.Brown, CeramicBrickType.Chequered).getStack(1));
|
||||
itemList.add(new CeramicBrickPair(EnumFlowerColor.Gold, EnumFlowerColor.Brown, CeramicBrickType.LargeBrick).getStack(1));
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
@@ -120,49 +120,49 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
ModelManager.registerCustomBlockModel(new BlockModelEntry(
|
||||
new ModelResourceLocation(resourceLocation, "normal"),
|
||||
new ModelResourceLocation(resourceLocation, "inventory"),
|
||||
new ModelMutlipass(BlockCeramicBrick.class), this));
|
||||
new ModelMutlipass<>(BlockCeramicBrick.class), this));
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, new CeramicBrickMeshDefinition());
|
||||
}
|
||||
|
||||
|
||||
private class CeramicBrickMeshDefinition implements ItemMeshDefinition{
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return new ModelResourceLocation(Constants.BOTANY_MOD_ID + ":ceramicBrick", "inventory");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new ExtendedBlockState(this, new IProperty[]{TYPE}, new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(TYPE, CeramicBrickType.VALUES[meta]);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(TYPE).ordinal();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return ((IExtendedBlockState)super.getExtendedState(state, world, pos)).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) {
|
||||
return getDefaultState().withProperty(TYPE, CeramicBrickType.get(meta >> 16 & 0xFF));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
|
||||
TileCeramicBrick ceramic = TileUtil.getTile(worldIn, pos, TileCeramicBrick.class);
|
||||
@@ -194,13 +194,13 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
}
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses() {
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ItemBotany extends Item implements IColoredItem, IItemModelRegister
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List list, final boolean flag) {
|
||||
public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List<String> list, final boolean flag) {
|
||||
if (!itemStack.hasTagCompound()) {
|
||||
return;
|
||||
}
|
||||
@@ -138,11 +138,11 @@ public class ItemBotany extends Item implements IColoredItem, IItemModelRegister
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item item, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubItems(final Item item, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
this.addCreativeItems(itemList, true);
|
||||
}
|
||||
|
||||
public void addCreativeItems(final List itemList, final boolean hideSecrets) {
|
||||
public void addCreativeItems(final List<ItemStack> itemList, final boolean hideSecrets) {
|
||||
for (final IIndividual individual : BotanyCore.getFlowerRoot().getIndividualTemplates()) {
|
||||
if (hideSecrets && individual.isSecret() && !Config.isDebug) {
|
||||
continue;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ItemInsulatedTube extends ItemCore implements IColoredItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List subItems) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> subItems) {
|
||||
for (Material mat : Material.values()) {
|
||||
for (Insulate ins : Insulate.values()) {
|
||||
subItems.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
@@ -54,7 +54,7 @@ public class ItemInsulatedTube extends ItemCore implements IColoredItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
tooltip.add(Insulate.get(itemStack.getItemDamage()).getName());
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class BlockPlant extends BlockBush implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item p_149666_1_, final CreativeTabs p_149666_2_, final List subBlocks) {
|
||||
public void getSubBlocks(final Item p_149666_1_, final CreativeTabs p_149666_2_, final List<ItemStack> subBlocks) {
|
||||
for (final Type type : Type.values()) {
|
||||
subBlocks.add(type.get());
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
par3List.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
@@ -192,7 +192,7 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumAcidity getPH(final World world, final BlockPos pos) {
|
||||
return world.getBlockState(pos).getValue(ACIDITY);
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ItemSoil extends ItemBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer playerIn, final List tooltip, final boolean advanced) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer playerIn, final List<String> tooltip, final boolean advanced) {
|
||||
String info = "";
|
||||
info += BlockSoil.getMoisture(stack, true, true);
|
||||
if (info.length() > 0) {
|
||||
|
||||
@@ -936,7 +936,7 @@ public enum FlowerDefinition implements IFlowerDefinition {
|
||||
}
|
||||
};
|
||||
|
||||
IFlowerType type;
|
||||
IFlowerType<EnumFlowerType> type;
|
||||
String name;
|
||||
String binomial;
|
||||
String branchName;
|
||||
@@ -968,19 +968,19 @@ public enum FlowerDefinition implements IFlowerDefinition {
|
||||
private IAllele[] template;
|
||||
private IFlowerGenome genome;
|
||||
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType type, final EnumFlowerColor colour) {
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType<EnumFlowerType> type, final EnumFlowerColor colour) {
|
||||
this(name, branch, binomial, type, false, colour, colour);
|
||||
}
|
||||
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType type, final EnumFlowerColor primaryColor, final EnumFlowerColor secondaryColor) {
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType<EnumFlowerType> type, final EnumFlowerColor primaryColor, final EnumFlowerColor secondaryColor) {
|
||||
this(name, branch, binomial, type, true, primaryColor, secondaryColor);
|
||||
}
|
||||
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType type, final boolean isDominant, final EnumFlowerColor colour) {
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType<EnumFlowerType> type, final boolean isDominant, final EnumFlowerColor colour) {
|
||||
this(name, branch, binomial, type, isDominant, colour, colour);
|
||||
}
|
||||
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType flowerType, final boolean isDominant, final EnumFlowerColor primaryColor, final EnumFlowerColor secondaryColor) {
|
||||
FlowerDefinition(final String name, final String branch, final String binomial, final IFlowerType<EnumFlowerType> flowerType, final boolean isDominant, final EnumFlowerColor primaryColor, final EnumFlowerColor secondaryColor) {
|
||||
String uid = Constants.BOTANY_MOD_ID + ".flower" + this;
|
||||
String unlocalizedDescription = "botany.description.flower" + this;
|
||||
String unlocalizedName = "botany.flowers.species." + name;
|
||||
@@ -1068,7 +1068,8 @@ public enum FlowerDefinition implements IFlowerDefinition {
|
||||
public static void preInitFlowers() {
|
||||
MinecraftForge.EVENT_BUS.post(new AlleleSpeciesRegisterEvent(FlowerManager.flowerRoot));
|
||||
for (FlowerDefinition def : values()) {
|
||||
IFlowerType type = def.species.getType();
|
||||
@SuppressWarnings("unchecked")
|
||||
IFlowerType<EnumFlowerType> type = def.species.getType();
|
||||
if (EnumFlowerType.highestSection < type.getSections()) {
|
||||
EnumFlowerType.highestSection = type.getSections();
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ public class FlowerRoot extends SpeciesRoot implements IFlowerRoot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getMemberClass() {
|
||||
public Class<IFlower> getMemberClass() {
|
||||
return IFlower.class;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ItemDictionary extends Item implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public enum BotanyItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(List tooltip) {
|
||||
public void addInformation(List<String> tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
return new IBinnieGUID[0];
|
||||
}
|
||||
|
||||
public Class[] getConfigs() {
|
||||
public Class<?>[] getConfigs() {
|
||||
return new Class[0];
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
}
|
||||
registerModules();
|
||||
if (this.getConfigs() != null) {
|
||||
for (final Class cls : this.getConfigs()) {
|
||||
for (final Class<?> cls : this.getConfigs()) {
|
||||
Binnie.CONFIGURATION.registerConfiguration(cls, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import javax.vecmath.Vector3f;
|
||||
import java.util.EnumMap;
|
||||
|
||||
public abstract class BaseBakedModel implements IPerspectiveAwareModel {
|
||||
private final EnumMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = new EnumMap(ItemCameraTransforms.TransformType.class);
|
||||
private final EnumMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = new EnumMap<>(ItemCameraTransforms.TransformType.class);
|
||||
private final ResourceLocation particle;
|
||||
|
||||
public BaseBakedModel() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.List;
|
||||
|
||||
public interface IItemMiscProvider extends IItemEnum {
|
||||
|
||||
void addInformation(List tooltip);
|
||||
void addInformation(List<String> tooltip);
|
||||
|
||||
String getModelPath();
|
||||
}
|
||||
@@ -73,8 +73,8 @@ public class ItemFieldKit extends ItemCore {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack p_77624_1_, final EntityPlayer p_77624_2_, final List p_77624_3_, final boolean p_77624_4_) {
|
||||
final int i = this.getMaxDamage() - p_77624_1_.getItemDamage();
|
||||
public void addInformation(final ItemStack p_77624_1_, final EntityPlayer p_77624_2_, final List<String> p_77624_3_, final boolean p_77624_4_) {
|
||||
final int i = p_77624_1_.getMaxDamage() - p_77624_1_.getItemDamage();
|
||||
if (i == 0) {
|
||||
p_77624_3_.add("No paper");
|
||||
} else {
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ItemGenesis extends ItemCore {
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
BinnieCore.proxy.openGui(BinnieCoreGUI.Genesis, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
return new ActionResult(EnumActionResult.SUCCESS, itemStack);
|
||||
return new ActionResult<>(EnumActionResult.SUCCESS, itemStack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ItemFluidContainer extends ItemFood implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List subItems) {
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List<ItemStack> subItems) {
|
||||
super.getSubItems(item, tab, subItems);
|
||||
for (final IFluidType liquid : Binnie.LIQUID.fluids.values()) {
|
||||
if (!liquid.canPlaceIn(this.container)) {
|
||||
@@ -127,7 +127,7 @@ public class ItemFluidContainer extends ItemFood implements IItemModelRegister {
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
|
||||
if (this.isDrinkable(stack) && player.canEat(false)) {
|
||||
player.setActiveHand(hand);
|
||||
return new ActionResult(EnumActionResult.SUCCESS, stack);
|
||||
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
||||
}else{
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.Map;
|
||||
|
||||
public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, INetwork.TilePacketSync, IMachine, INetwork.GuiNBT {
|
||||
private MachinePackage machinePackage;
|
||||
private Map<Class, List<MachineComponent>> componentInterfaceMap;
|
||||
private Map<Class<? extends MachineComponent>, List<MachineComponent>> componentInterfaceMap;
|
||||
private Map<Class<? extends MachineComponent>, MachineComponent> componentMap;
|
||||
private TileEntity tile;
|
||||
private boolean queuedInventoryUpdate;
|
||||
@@ -55,7 +55,7 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
|
||||
}
|
||||
component.setMachine(this);
|
||||
this.componentMap.put(component.getClass(), component);
|
||||
for (final Class inter : component.getComponentInterfaces()) {
|
||||
for (final Class<? extends MachineComponent> inter : component.getComponentInterfaces()) {
|
||||
if (!this.componentInterfaceMap.containsKey(inter)) {
|
||||
this.componentInterfaceMap.put(inter, new ArrayList<>());
|
||||
}
|
||||
@@ -256,7 +256,7 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public Packet getDescriptionPacket() {
|
||||
public Packet<?> getDescriptionPacket() {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.syncToNBT(nbt);
|
||||
if (nbt.hasNoTags()) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class MachineComponent implements INbtReadable, INbtWritable {
|
||||
public void onUpdate() {
|
||||
}
|
||||
|
||||
public Class[] getComponentInterfaces() {
|
||||
public Class<? extends MachineComponent>[] getComponentInterfaces() {
|
||||
return Binnie.MACHINE.getComponentInterfaces(this.getClass());
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ManagerMachine extends ManagerBase {
|
||||
private Map<Class<?>, Class<?>[]> componentInterfaceMap;
|
||||
private Map<Class<?>, Class<? extends MachineComponent>[]> componentInterfaceMap;
|
||||
private Map<String, MachineGroup> machineGroups;
|
||||
private Map<Integer, Class<?>> networkIDToComponent;
|
||||
private Map<Class<?>, Integer> componentToNetworkID;
|
||||
@@ -41,6 +41,7 @@ public class ManagerMachine extends ManagerBase {
|
||||
return (machineGroup == null) ? null : machineGroup.getPackage(name);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void registerComponentClass(final Class<? extends MachineComponent> component) {
|
||||
if (this.componentInterfaceMap.containsKey(component)) {
|
||||
return;
|
||||
@@ -83,7 +84,7 @@ public class ManagerMachine extends ManagerBase {
|
||||
BinnieCore.proxy.registerTileEntity(TileEntityMachine.class, "binnie.tile.machine", rendererMachine);
|
||||
}
|
||||
|
||||
public Class<?>[] getComponentInterfaces(final Class<? extends MachineComponent> clss) {
|
||||
public Class<? extends MachineComponent>[] getComponentInterfaces(final Class<? extends MachineComponent> clss) {
|
||||
if (!this.componentInterfaceMap.containsKey(clss)) {
|
||||
this.registerComponentClass(clss);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public @interface ConfigProperty {
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@interface Type {
|
||||
Class<? extends PropertyBase> propertyClass();
|
||||
Class<? extends PropertyBase<?, ?>> propertyClass();
|
||||
|
||||
String category() default "general";
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ManagerConfig extends ManagerBase {
|
||||
if (annotation.annotationType().isAnnotationPresent(ConfigProperty.Type.class)) {
|
||||
final Class<?> propertyClass = annotation.annotationType().getAnnotation(ConfigProperty.Type.class).propertyClass();
|
||||
try {
|
||||
final PropertyBase property = (PropertyBase) propertyClass.getConstructor(Field.class, BinnieConfiguration.class, ConfigProperty.class, annotation.annotationType()).newInstance(field, config, propertyAnnot, annotation.annotationType().cast(annotation));
|
||||
final PropertyBase<?, ?> property = (PropertyBase<?, ?>) propertyClass.getConstructor(Field.class, BinnieConfiguration.class, ConfigProperty.class, annotation.annotationType()).newInstance(field, config, propertyAnnot, annotation.annotationType().cast(annotation));
|
||||
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ package binnie.core.network.packet;
|
||||
import net.minecraft.network.Packet;
|
||||
|
||||
public interface IPacket {
|
||||
Packet getPacket();
|
||||
Packet<?> getPacket();
|
||||
}
|
||||
@@ -49,13 +49,12 @@ public class ControlList<T> extends Control implements IControlValue<T> {
|
||||
public void setOptions(final Collection<T> options) {
|
||||
this.deleteAllChildren();
|
||||
this.allOptions.clear();
|
||||
int i = 0;
|
||||
for (final T option : options) {
|
||||
final IWidget optionWidget = ((ControlListBox) this.getParent()).createOption(option, 0);
|
||||
@SuppressWarnings("unchecked")
|
||||
final IWidget optionWidget = ((ControlListBox<T>) this.getParent()).createOption(option, 0);
|
||||
if (optionWidget != null) {
|
||||
this.allOptions.put(option, optionWidget);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
this.filterOptions();
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ public class Tooltip {
|
||||
return string;
|
||||
}
|
||||
|
||||
public void add(final List list) {
|
||||
for (final Object obj : list) {
|
||||
this.tooltip.add((String) obj);
|
||||
public void add(final List<String> list) {
|
||||
for (final String obj : list) {
|
||||
this.tooltip.add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Widget implements IWidget {
|
||||
IWidget cropWidget;
|
||||
boolean cropped;
|
||||
int colour;
|
||||
private Collection<EventHandler> globalEventHandlers;
|
||||
private Collection<EventHandler<? extends Event>> globalEventHandlers;
|
||||
private boolean enabled;
|
||||
private boolean visible;
|
||||
|
||||
@@ -219,12 +219,12 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEventHandler(final EventHandler handler) {
|
||||
public <E extends Event> void addEventHandler(final EventHandler<E> handler) {
|
||||
this.globalEventHandlers.add(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSelfEventHandler(final EventHandler handler) {
|
||||
public <E extends Event> void addSelfEventHandler(final EventHandler<E> handler) {
|
||||
this.addEventHandler(handler.setOrigin(EventHandler.Origin.Self, this));
|
||||
}
|
||||
|
||||
@@ -234,10 +234,11 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public final void recieveEvent(final Event event) {
|
||||
for (final EventHandler handler : this.globalEventHandlers) {
|
||||
for (final EventHandler<? extends Event> handler : this.globalEventHandlers) {
|
||||
if (handler.handles(event)) {
|
||||
handler.onEvent(event);
|
||||
((EventHandler<Event>)handler).onEvent(event);
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -438,6 +439,7 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getWidget(final Class<T> x) {
|
||||
for (final IWidget child : this.getWidgets()) {
|
||||
if (x.isInstance(child)) {
|
||||
|
||||
@@ -13,7 +13,7 @@ public abstract class EventHandler<E extends Event> {
|
||||
this.eventClass = eventClass;
|
||||
}
|
||||
|
||||
public EventHandler setOrigin(final Origin origin, final IWidget relative) {
|
||||
public EventHandler<E> setOrigin(final Origin origin, final IWidget relative) {
|
||||
this.origin = origin;
|
||||
this.relative = relative;
|
||||
return this;
|
||||
|
||||
@@ -61,8 +61,8 @@ public class ContainerCraftGUI extends Container {
|
||||
this.window = window;
|
||||
final IMachine machine = Machine.getMachine(window.getInventory());
|
||||
if (this.getSide() == Side.SERVER) {
|
||||
this.inventoryItemStacks = new ListMap();
|
||||
this.inventorySlots = new ListMap();
|
||||
this.inventoryItemStacks = new ListMap<>();
|
||||
this.inventorySlots = new ListMap<>();
|
||||
if (machine != null) {
|
||||
final GameProfile user = machine.getOwner();
|
||||
if (user != null) {
|
||||
|
||||
@@ -6,8 +6,6 @@ import binnie.craftgui.minecraft.Window;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -31,7 +29,7 @@ public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies> {
|
||||
final List<IAlleleSpecies> speciesList2 = new ArrayList<>();
|
||||
this.movePercentage(-100.0f);
|
||||
this.setOptions(speciesList2);
|
||||
final EntityPlayer player = Window.get(this).getPlayer();
|
||||
//final EntityPlayer player = Window.get(this).getPlayer();
|
||||
final GameProfile playerName = Window.get(this).getUsername();
|
||||
final WindowAbstractDatabase db = Window.get(this);
|
||||
final Collection<IAlleleSpecies> speciesList3 = db.isNEI ? db.getBreedingSystem().getAllSpecies() : db.getBreedingSystem().getDiscoveredSpecies(db.getWorld(), playerName);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ItemIndustrialFrame extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
for (final IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
final ItemStack stack = new ItemStack(this);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
@@ -59,7 +59,7 @@ public enum ExtraBeeItems implements IItemMiscProvider {
|
||||
OreDictionary.registerOre("dyeBlack", ExtraBeeItems.BlackDye.get(1));
|
||||
OreDictionary.registerOre("dyeWhite", ExtraBeeItems.WhiteDye.get(1));
|
||||
OreDictionary.registerOre("dyeBrown", ExtraBeeItems.BrownDye.get(1));
|
||||
|
||||
|
||||
OreDictionary.registerOre("gearWood", ExtraBeeItems.ScentedGear.get(1));
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public enum ExtraBeeItems implements IItemMiscProvider {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void addInformation(final List par3List) {
|
||||
public void addInformation(final List<String> par3List) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ItemDictionary extends Item implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
|
||||
@@ -34,6 +34,6 @@ public class ItemPunnettSquare extends Item {
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, EnumHand hand) {
|
||||
if (hand == EnumHand.MAIN_HAND)
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
return new ActionResult(EnumActionResult.PASS, itemStackIn);
|
||||
return new ActionResult<>(EnumActionResult.PASS, itemStackIn);
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class ItemProduct extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
for (final IItemEnum type : this.types) {
|
||||
if (type.isActive()) {
|
||||
itemList.add(new ItemStack(this, 1, type.ordinal()));
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ItemBeehive extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
for (int i = 0; i < EnumHiveType.values().length; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ExtraTrees extends AbstractMod {
|
||||
public void postInit(final FMLPostInitializationEvent evt) {
|
||||
this.postInit();
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
private static ModuleBlocks blocks;
|
||||
@Nullable
|
||||
@@ -83,7 +83,7 @@ public class ExtraTrees extends AbstractMod {
|
||||
private static ModuleMachine machine;
|
||||
@Nullable
|
||||
private static ModuleKitchen kitchen;
|
||||
|
||||
|
||||
public static ModuleItems items() {
|
||||
Preconditions.checkState(items != null);
|
||||
return items;
|
||||
@@ -93,18 +93,18 @@ public class ExtraTrees extends AbstractMod {
|
||||
Preconditions.checkState(blocks != null);
|
||||
return blocks;
|
||||
}
|
||||
|
||||
|
||||
public static ModuleAlcohol alcohol() {
|
||||
Preconditions.checkState(alcohol != null);
|
||||
return alcohol;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static ModuleCarpentry carpentry() {
|
||||
Preconditions.checkState(carpentry != null);
|
||||
return carpentry;
|
||||
}
|
||||
|
||||
|
||||
public static ModuleMachine machine() {
|
||||
Preconditions.checkState(machine != null);
|
||||
return machine;
|
||||
@@ -133,7 +133,7 @@ public class ExtraTrees extends AbstractMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getConfigs() {
|
||||
public Class<?>[] getConfigs() {
|
||||
return new Class[]{ConfigurationMain.class};
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class ItemDrink extends ItemFood implements IFluidContainerItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
for (final Glassware glassware : Glassware.values()) {
|
||||
par3List.add(this.getStack(glassware, null));
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ public class ModuleBlocks implements IInitializable {
|
||||
public List<BlockETSlab> slabsDouble;
|
||||
public List<BlockETSlab> slabsFireproof;
|
||||
public List<BlockETSlab> slabsDoubleFireproof;
|
||||
public List<BlockForestryStairs> stairs;
|
||||
public List<BlockForestryStairs> stairsFireproof;
|
||||
public List<BlockForestryStairs<EnumETLog>> stairs;
|
||||
public List<BlockForestryStairs<EnumETLog>> stairsFireproof;
|
||||
public List<BlockETFence> fences;
|
||||
public List<BlockETFence> fencesFireproof;
|
||||
public List<BlockForestryFenceGate> fenceGates;
|
||||
public List<BlockForestryFenceGate> fenceGatesFireproof;
|
||||
public List<BlockForestryFenceGate<EnumETLog>> fenceGates;
|
||||
public List<BlockForestryFenceGate<EnumETLog>> fenceGatesFireproof;
|
||||
public List<BlockETDecorativeLeaves> leavesDecorative;
|
||||
public Map<String, ItemStack> speciesToLeavesDecorative;
|
||||
public Block blockDoor;
|
||||
@@ -69,21 +69,21 @@ public class ModuleBlocks implements IInitializable {
|
||||
public BlockHedge blockHedge;
|
||||
//????
|
||||
public Block blockBranch;
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
PlankType.setup();
|
||||
|
||||
|
||||
//TODO: clean up
|
||||
logs = BlockETLog.create(false);
|
||||
for (BlockETLog block : logs) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
logsFireproof = BlockETLog.create(true);
|
||||
for (BlockETLog block : logsFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
@@ -91,22 +91,22 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
woodAccess.registerLogs(logs);
|
||||
woodAccess.registerLogs(logsFireproof);
|
||||
|
||||
|
||||
planks = BlockETPlank.create(false);
|
||||
for (BlockETPlank block : planks) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
planksFireproof = BlockETPlank.create(true);
|
||||
for (BlockETPlank block : planksFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
woodAccess.registerPlanks(planks);
|
||||
woodAccess.registerPlanks(planksFireproof);
|
||||
|
||||
|
||||
slabs = BlockETSlab.create(false, false);
|
||||
slabsDouble = BlockETSlab.create(false, true);
|
||||
for (int i = 0; i < slabs.size(); i++) {
|
||||
@@ -128,18 +128,18 @@ public class ModuleBlocks implements IInitializable {
|
||||
}
|
||||
woodAccess.registerSlabs(slabs);
|
||||
woodAccess.registerSlabs(slabsFireproof);
|
||||
|
||||
|
||||
stairs = new ArrayList<>();
|
||||
for (BlockETPlank plank : planks) {
|
||||
for (IBlockState blockState : plank.getBlockState().getValidStates()) {
|
||||
int meta = plank.getMetaFromState(blockState);
|
||||
EnumETLog woodType = plank.getWoodType(meta);
|
||||
|
||||
BlockForestryStairs stair = new BlockForestryStairs(false, blockState, woodType);
|
||||
BlockForestryStairs<EnumETLog> stair = new BlockForestryStairs<>(false, blockState, woodType);
|
||||
String name = "stairs." + woodType;
|
||||
stair.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
stair.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemBlockETWood(stair));
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemBlockETWood<>(stair));
|
||||
stairs.add(stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
}
|
||||
@@ -151,61 +151,62 @@ public class ModuleBlocks implements IInitializable {
|
||||
int meta = plank.getMetaFromState(blockState);
|
||||
EnumETLog woodType = plank.getWoodType(meta);
|
||||
|
||||
BlockForestryStairs stair = new BlockForestryStairs(true, blockState, woodType);
|
||||
BlockForestryStairs<EnumETLog> stair = new BlockForestryStairs<>(true, blockState, woodType);
|
||||
String name = "stairs.fireproof." + woodType;
|
||||
stair.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
stair.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemBlockETWood(stair));
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemBlockETWood<>(stair));
|
||||
stairsFireproof.add(stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
woodAccess.registerStairs(stairs);
|
||||
woodAccess.registerStairs(stairsFireproof);
|
||||
|
||||
|
||||
fences = BlockETFence.create(false);
|
||||
for (BlockETFence block : fences) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_WOOD, block);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", block.getRegistryName().toString());
|
||||
}
|
||||
|
||||
fencesFireproof = BlockETFence.create(true);
|
||||
for (BlockETFence block : fencesFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_WOOD, block);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", block.getRegistryName().toString());
|
||||
}
|
||||
|
||||
|
||||
woodAccess.registerFences(fences);
|
||||
woodAccess.registerFences(fencesFireproof);
|
||||
|
||||
|
||||
fenceGates = new ArrayList<>();
|
||||
fenceGatesFireproof = new ArrayList<>();
|
||||
for (PlankType.ExtraTreePlanks plankType : PlankType.ExtraTreePlanks.VALUES) {
|
||||
EnumETLog woodType = plankType.getWoodType();
|
||||
BlockForestryFenceGate fenceGate = new BlockForestryFenceGate(false, woodType);
|
||||
BlockForestryFenceGate<EnumETLog> fenceGate = new BlockForestryFenceGate<>(false, woodType);
|
||||
String name = "fence.gates." + woodType;
|
||||
fenceGate.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
fenceGate.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(fenceGate, new ItemBlockETWood(fenceGate));
|
||||
ExtraTrees.proxy.registerBlock(fenceGate, new ItemBlockETWood<>(fenceGate));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_GATE_WOOD, fenceGate);
|
||||
fenceGates.add(fenceGate);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", fenceGate.getRegistryName().toString());
|
||||
|
||||
BlockForestryFenceGate fenceGateFireproof = new BlockForestryFenceGate(true, woodType);
|
||||
BlockForestryFenceGate<EnumETLog> fenceGateFireproof = new BlockForestryFenceGate<>(true, woodType);
|
||||
String nameFireproof = "fence.gates.fireproof." + woodType;
|
||||
fenceGateFireproof.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, nameFireproof));
|
||||
fenceGateFireproof.setUnlocalizedName(nameFireproof);
|
||||
ExtraTrees.proxy.registerBlock(fenceGateFireproof, new ItemBlockETWood(fenceGateFireproof));
|
||||
ExtraTrees.proxy.registerBlock(fenceGateFireproof, new ItemBlockETWood<>(fenceGateFireproof));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_GATE_WOOD, fenceGateFireproof);
|
||||
fenceGatesFireproof.add(fenceGateFireproof);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", fenceGateFireproof.getRegistryName().toString());
|
||||
}
|
||||
|
||||
woodAccess.registerFenceGates(fenceGates);
|
||||
woodAccess.registerFenceGates(fenceGatesFireproof);
|
||||
|
||||
//Forestry's API doesn't allow typed lists to be registered, but making a new one allows us to get away with it
|
||||
woodAccess.registerFenceGates(new ArrayList<>(fenceGates));
|
||||
woodAccess.registerFenceGates(new ArrayList<>(fenceGatesFireproof));
|
||||
|
||||
blockMultiFence = new BlockMultiFence();
|
||||
GameRegistry.register(blockMultiFence);
|
||||
@@ -304,16 +305,16 @@ public class ModuleBlocks implements IInitializable {
|
||||
public void addSqueezer(final IWoodType log, final ILiquidType liquid, final int amount) {
|
||||
this.addSqueezer(log, liquid, amount, 0.5f);
|
||||
}
|
||||
|
||||
|
||||
private static void addRecipeAtPosition(int position, IRecipe recipe){
|
||||
CraftingManager manager = CraftingManager.getInstance();
|
||||
manager.getRecipeList().add(position, recipe);
|
||||
}
|
||||
|
||||
|
||||
private static void registerOreDictWildcard(String oreDictName, Block block) {
|
||||
OreDictionary.registerOre(oreDictName, new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack getDecorativeLeaves(String speciesUid) {
|
||||
ItemStack itemStack = ExtraTrees.blocks().speciesToLeavesDecorative.get(speciesUid);
|
||||
if (itemStack == null) {
|
||||
|
||||
@@ -69,7 +69,7 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
}
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, 0.0f, f3, f2, 1.0f, f4));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
final boolean connectNegZ = this.canConnectFenceTo(world, pos.north());
|
||||
@@ -94,17 +94,17 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
}
|
||||
return new AxisAlignedBB(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos) {
|
||||
return false;
|
||||
@@ -120,7 +120,7 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
Block block = state.getBlock();
|
||||
return block == this || canConnectTo(world, pos) || block.isLeaves(state, world, pos) || (state.getMaterial().isOpaque() && state.isFullCube() && state.getMaterial() != Material.GOURD);
|
||||
}
|
||||
|
||||
|
||||
private boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
@@ -129,7 +129,7 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
}
|
||||
|
||||
if (block != Blocks.BARRIER) {
|
||||
Material blockMaterial = block.getMaterial(state);
|
||||
Material blockMaterial = state.getMaterial();
|
||||
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof IBlockFence) {
|
||||
return blockMaterial == this.blockMaterial;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List<ItemStack> list) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int f = 0; f < 2; ++f) {
|
||||
list.add(new ItemStack(item, 1, i + f * 8));
|
||||
|
||||
@@ -110,12 +110,12 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
public DesignBlock getCarpentryBlock(final IBlockAccess world, final BlockPos pos) {
|
||||
return ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getTileMetadata(world, pos));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
|
||||
@@ -128,7 +128,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
}
|
||||
return block.getPrimaryColour();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
@@ -162,13 +162,13 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), tileMetadata);
|
||||
return block.getItemMetadata(this.getDesignSystem());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumBlockRenderType getRenderType(IBlockState state){
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
@@ -177,34 +177,34 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
ModelManager.registerCustomBlockModel(new BlockModelEntry(
|
||||
new ModelResourceLocation(registryName, "normal"),
|
||||
new ModelResourceLocation(registryName, "inventory"),
|
||||
new ModelMutlipass(BlockDesign.class), this));
|
||||
new ModelMutlipass<>(BlockDesign.class), this));
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, new DesignMeshDefinition());
|
||||
}
|
||||
|
||||
|
||||
private class DesignMeshDefinition implements ItemMeshDefinition{
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return new ModelResourceLocation(getRegistryName(), "inventory");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return ((IExtendedBlockState)state).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderPasses() {
|
||||
@@ -234,7 +234,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
if(facing == null){
|
||||
return block.getPrimarySprite(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[0]);
|
||||
}
|
||||
|
||||
|
||||
if(pass > 0){
|
||||
return block.getSecondarySprite(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[facing.ordinal()]);
|
||||
}
|
||||
|
||||
+2
-3
@@ -10,10 +10,9 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class FruitPressRecipeCategory extends BlankRecipeCategory {
|
||||
public class FruitPressRecipeCategory extends BlankRecipeCategory<FruitPressRecipeWrapper> {
|
||||
private final IDrawableAnimated arrowAnimated;
|
||||
|
||||
public FruitPressRecipeCategory() {
|
||||
@@ -49,7 +48,7 @@ public class FruitPressRecipeCategory extends BlankRecipeCategory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
public void setRecipe(IRecipeLayout recipeLayout, FruitPressRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IDrawable tankOverlay = ExtraTreesJeiPlugin.drawables.getTankOverlay();
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
fluidStacks.init(FruitPressMachine.TANK_OUTPUT, false, 55, 1, 16, 58, 1000, false, tankOverlay);
|
||||
|
||||
@@ -36,7 +36,7 @@ public enum ExtraTreeItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final List par3List) {
|
||||
public void addInformation(final List<String> par3List) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,7 @@ public enum Food implements IItemMiscProvider {
|
||||
CANDLENUT(0);
|
||||
|
||||
public static Food[] VALUES = values();
|
||||
|
||||
|
||||
int hunger;
|
||||
private List<String> ores;
|
||||
|
||||
@@ -119,7 +119,7 @@ public enum Food implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final List par3List) {
|
||||
public void addInformation(final List<String> par3List) {
|
||||
}
|
||||
|
||||
public void addJuice(final Juice juice, final int time, final int amount, final int mulch) {
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ItemArboristDatabase extends Item implements IItemModelRegister {
|
||||
this.setMaxStackSize(1);
|
||||
setRegistryName("databaseTree");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
@@ -39,7 +39,7 @@ public class ItemArboristDatabase extends Item implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemMothDatabase extends Item implements IItemModelRegister {
|
||||
|
||||
|
||||
public ItemMothDatabase() {
|
||||
this.setCreativeTab(Tabs.tabLepidopterology);
|
||||
this.setUnlocalizedName("databaseMoth");
|
||||
this.setMaxStackSize(1);
|
||||
setRegistryName("databaseMoth");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
@@ -46,7 +46,7 @@ public class ItemMothDatabase extends Item implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class MachineRendererForestry {
|
||||
|
||||
private static void loadMethod(final String file, final boolean waterTank, final boolean productTank) {
|
||||
try {
|
||||
final Class clss = Class.forName("forestry.core.render.RenderMachine");
|
||||
final Class<?> clss = Class.forName("forestry.core.render.RenderMachine");
|
||||
final Object instance = clss.getConstructor(String.class).newInstance(file);
|
||||
//MachineRendererForestry.renderMethod = clss.getDeclaredMethod("render", TankRenderInfo.class, TankRenderInfo.class, ForgeDirection.class, Double.TYPE, Double.TYPE, Double.TYPE);
|
||||
MachineRendererForestry.renderMethod.setAccessible(true);
|
||||
|
||||
@@ -45,8 +45,8 @@ public class GeneArrayItem implements INbtReadable, INbtWritable, IGeneItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getInfo(final List list) {
|
||||
final List<Object> totalList = new ArrayList<>();
|
||||
public void getInfo(final List<String> list) {
|
||||
final List<String> totalList = new ArrayList<>();
|
||||
for (IGene gene : this.genes) {
|
||||
final String chromosomeName = this.getBreedingSystem().getChromosomeName(gene.getChromosome());
|
||||
totalList.add(TextFormatting.GOLD + chromosomeName + TextFormatting.GRAY + ": " + gene.getName());
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GeneItem implements INbtReadable, INbtWritable, IGeneItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getInfo(final List list) {
|
||||
public void getInfo(final List<String> list) {
|
||||
final String chromosomeName = this.getBreedingSystem().getChromosomeName(this.gene.getChromosome());
|
||||
list.add(TextFormatting.GOLD + chromosomeName + TextFormatting.GRAY + ": " + this.gene.getName());
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
public interface IGeneItem {
|
||||
ISpeciesRoot getSpeciesRoot();
|
||||
|
||||
void getInfo(final List p0);
|
||||
void getInfo(final List<String> p0);
|
||||
|
||||
int getColour(final int p0);
|
||||
|
||||
|
||||
+2
-3
@@ -10,10 +10,9 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class IncubatorRecipeCategory extends BlankRecipeCategory {
|
||||
public class IncubatorRecipeCategory extends BlankRecipeCategory<IncubatorRecipeWrapper> {
|
||||
private final IDrawableAnimated arrowAnimated;
|
||||
|
||||
public IncubatorRecipeCategory() {
|
||||
@@ -51,7 +50,7 @@ public class IncubatorRecipeCategory extends BlankRecipeCategory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IncubatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
fluidStacks.init(Incubator.TANK_INPUT, true, 1, 1, 16, 58, 50, false, tankOverlay);
|
||||
|
||||
@@ -35,7 +35,7 @@ public enum GeneticsItems implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final List par3List) {
|
||||
public void addInformation(final List<String> par3List) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,14 +34,15 @@ public abstract class ItemGene extends ItemCore {
|
||||
}
|
||||
|
||||
public int getCharges(final ItemStack stack) {
|
||||
return (stack == null) ? 0 : (stack.getItem().getMaxDamage() - stack.getItemDamage());
|
||||
return (stack == null) ? 0 : (stack.getMaxDamage() - stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List list, final boolean advanced) {
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List<String> list, final boolean advanced) {
|
||||
super.addInformation(itemstack, entityPlayer, list, advanced);
|
||||
final int damage = this.getMaxDamage() - itemstack.getItemDamage();
|
||||
|
||||
final int damage = itemstack.getMaxDamage() - itemstack.getItemDamage();
|
||||
if (damage == 0) {
|
||||
list.add(Binnie.LANGUAGE.localise("genetic.item.gene.empty"));
|
||||
} else if (damage == 1) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ItemSequence extends ItemCore implements IItemAnalysable, IItemChar
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List list, final boolean par4) {
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List<String> list, final boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
list.add(Genetics.proxy.localise("item.sequence." + (5 - itemstack.getItemDamage() % 6)));
|
||||
final SequencerItem gene = new SequencerItem(itemstack);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List list, final boolean par4) {
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List<String> list, final boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List list, final boolean par4) {
|
||||
public void addInformation(final ItemStack itemstack, final EntityPlayer entityPlayer, final List<String> list, final boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user