Skip to content

Commit 01634d4

Browse files
committed
FlowerRoot.java - remove method override getRandomTemplate. It is same as in parent class.
1 parent 491bca8 commit 01634d4

File tree

17 files changed

+78
-63
lines changed

17 files changed

+78
-63
lines changed

core/src/main/java/binnie/core/AbstractMod.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import binnie.core.network.IPacketProvider;
2020
import binnie.core.network.packet.MessageBinnie;
2121
import binnie.core.proxy.IProxyCore;
22+
import binnie.core.util.EmptyHelper;
2223

2324
public abstract class AbstractMod implements IPacketProvider, IInitializable {
2425
protected final List<IInitializable> modules;
@@ -38,23 +39,17 @@ public AbstractMod() {
3839

3940
public abstract String getChannel();
4041

41-
private static final IPacketID[] PACKET_IDS_EMPTY = new IPacketID[0];
42-
4342
@Override
4443
public IPacketID[] getPacketIDs() {
45-
return PACKET_IDS_EMPTY;
44+
return EmptyHelper.PACKET_IDS_EMPTY;
4645
}
4746

48-
private static final IBinnieGUID[] BINNIE_GUIDS_EMPTY = new IBinnieGUID[0];
49-
5047
public IBinnieGUID[] getGUIDs() {
51-
return BINNIE_GUIDS_EMPTY;
48+
return EmptyHelper.BINNIE_GUIDS_EMPTY;
5249
}
5350

54-
private static final Class<?>[] CLASS_CONFIG_EMPTY = new Class[0];
55-
5651
public Class<?>[] getConfigs() {
57-
return CLASS_CONFIG_EMPTY;
52+
return EmptyHelper.CLASS_ARRAY_EMPTY;
5853
}
5954

6055
public abstract IProxyCore getProxy();

core/src/main/java/binnie/core/gui/genesis/WindowGenesis.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import binnie.core.gui.minecraft.control.ControlTabIcon;
4242
import binnie.core.gui.window.Panel;
4343
import binnie.core.util.I18N;
44+
import binnie.core.util.EmptyHelper;
4445
import binnie.core.gui.ControlGenesisOption;
4546
import net.minecraftforge.fml.relauncher.SideOnly;
4647

@@ -126,11 +127,11 @@ public void initialiseClient() {
126127
this.refreshTemplate(null);
127128
}
128129

129-
private static final IChromosomeType[] CHROMOSOME_TYPES_EMPTY = new IChromosomeType[0];
130+
130131

131132
private void refreshTemplate(@Nullable IChromosomeType selection) {
132133
List<Gene> genes = new ArrayList<>();
133-
IChromosomeType[] chromosomeTypes = Binnie.GENETICS.getChromosomeMap(this.root).keySet().toArray(CHROMOSOME_TYPES_EMPTY);
134+
IChromosomeType[] chromosomeTypes = Binnie.GENETICS.getChromosomeMap(this.root).keySet().toArray(EmptyHelper.CHROMOSOME_TYPES_EMPTY);
134135
for (IChromosomeType type : chromosomeTypes) {
135136
IAllele allele = this.template[type.ordinal()];
136137
if (allele == null) {

core/src/main/java/binnie/core/gui/minecraft/ContainerCraftGUI.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import binnie.core.machines.transfer.TransferRequest;
2626
import binnie.core.machines.transfer.TransferResult;
2727
import binnie.core.network.packet.MessageContainerUpdate;
28+
import binnie.core.util.EmptyHelper;
2829
import com.google.common.base.Preconditions;
2930
import com.google.common.collect.Sets;
3031
import com.mojang.authlib.GameProfile;
@@ -383,7 +384,7 @@ public int getErrorType() {
383384
return this.errorType;
384385
}
385386

386-
private static final CustomSlot[] CUSTOM_SLOTS_EMPTY = new CustomSlot[0];
387+
387388

388389
public CustomSlot[] getCustomSlots() {
389390
final List<CustomSlot> slots = new ArrayList<>();
@@ -392,7 +393,7 @@ public CustomSlot[] getCustomSlots() {
392393
slots.add((CustomSlot) object);
393394
}
394395
}
395-
return slots.toArray(CUSTOM_SLOTS_EMPTY);
396+
return slots.toArray(EmptyHelper.CUSTOM_SLOTS_EMPTY);
396397
}
397398

398399
@SideOnly(Side.CLIENT)

core/src/main/java/binnie/core/machines/MachineComponent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package binnie.core.machines;
22

3+
import binnie.core.util.EmptyHelper;
34
import net.minecraft.inventory.IInventory;
45
import net.minecraft.nbt.NBTTagCompound;
56

@@ -36,12 +37,10 @@ public NBTTagCompound writeToNBT(final NBTTagCompound nbttagcompound) {
3637
public void onUpdate() {
3738
}
3839

39-
private static final Class[] CLASSES_EMPTY = new Class[0];
40-
4140
public Class<?>[] getComponentInterfaces() {
4241
Class<?>[] componentInterfaces = Binnie.MACHINE.getComponentInterfaces(this.getClass());
4342
if (componentInterfaces == null) {
44-
return CLASSES_EMPTY;
43+
return EmptyHelper.CLASS_ARRAY_EMPTY;
4544
}
4645
return componentInterfaces;
4746
}

core/src/main/java/binnie/core/machines/ManagerMachine.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import binnie.core.machines.inventory.ValidatorSprite;
1818
import binnie.core.machines.render.RenderTESRMachine;
1919
import binnie.core.proxy.IBinnieProxy;
20+
import binnie.core.util.EmptyHelper;
2021
import forestry.api.core.INbtReadable;
2122
import forestry.api.core.INbtWritable;
2223

@@ -64,8 +65,6 @@ public MachinePackage getPackage(final String group, final String name) {
6465
return (machineGroup == null) ? null : machineGroup.getPackage(name);
6566
}
6667

67-
private static final Class[] CLASSES_EMPTY = new Class[0];
68-
6968
private void registerComponentClass(final Class<? extends MachineComponent> component) {
7069
if (this.componentInterfaceMap.containsKey(component)) {
7170
return;
@@ -76,7 +75,7 @@ private void registerComponentClass(final Class<? extends MachineComponent> comp
7675
}
7776
interfaces.remove(INbtWritable.class);
7877
interfaces.remove(INbtReadable.class);
79-
this.componentInterfaceMap.put(component, interfaces.toArray(CLASSES_EMPTY));
78+
this.componentInterfaceMap.put(component, interfaces.toArray(EmptyHelper.CLASS_ARRAY_EMPTY));
8079
final int networkID = this.nextNetworkID++;
8180
}
8281

core/src/main/java/binnie/core/machines/base/DefaultMachineInventory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import net.minecraft.util.text.TextComponentString;
99

1010
import binnie.core.machines.inventory.IInventoryMachine;
11+
import binnie.core.util.EmptyHelper;
1112

1213
class DefaultMachineInventory implements IInventoryMachine {
1314
private final DefaultInventory inventory;
@@ -30,11 +31,9 @@ public boolean isUsableByPlayer(final EntityPlayer entityplayer) {
3031
public void markDirty() {
3132
}
3233

33-
private static final int[] SLOTS_FOR_FACE_EMPTY = new int[0];
34-
3534
@Override
3635
public int[] getSlotsForFace(EnumFacing side) {
37-
return SLOTS_FOR_FACE_EMPTY;
36+
return EmptyHelper.INT_ARRAY_EMPTY;
3837
}
3938

4039
@Override

core/src/main/java/binnie/core/machines/base/DefaultTankContainer.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import javax.annotation.Nullable;
44

5+
import binnie.core.util.EmptyHelper;
56
import net.minecraft.util.EnumFacing;
67

78
import net.minecraft.util.ResourceLocation;
@@ -15,11 +16,9 @@
1516

1617
class DefaultTankContainer implements ITankMachine {
1718

18-
private static final TankInfo[] TANK_INFOS_EMPTY = new TankInfo[0];
19-
2019
@Override
2120
public TankInfo[] getTankInfos() {
22-
return TANK_INFOS_EMPTY;
21+
return EmptyHelper.TANK_INFO_EMPTY;
2322
}
2423

2524
@Override
@@ -64,10 +63,8 @@ public IFluidHandler getHandler(int[] targetTanks) {
6463
return null;
6564
}
6665

67-
private static final IFluidTank[] FLUID_TANKS_EMPTY = new IFluidTank[0];
68-
6966
@Override
7067
public IFluidTank[] getTanks() {
71-
return FLUID_TANKS_EMPTY;
68+
return EmptyHelper.FLUID_TANKS_EMPTY;
7269
}
7370
}

core/src/main/java/binnie/core/machines/errors/ErrorState.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import binnie.core.machines.inventory.InventorySlot;
1111
import binnie.core.machines.inventory.SlotValidator;
1212
import binnie.core.machines.inventory.Validator;
13+
import binnie.core.util.EmptyHelper;
1314
import it.unimi.dsi.fastutil.ints.IntArraySet;
1415
import it.unimi.dsi.fastutil.ints.IntSet;
1516
import net.minecraft.entity.player.InventoryPlayer;
@@ -41,11 +42,9 @@ public ErrorState(IErrorStateDefinition definition, int data) {
4142
}
4243

4344
public ErrorState(IErrorStateDefinition nameDefinition, IErrorStateDefinition definition) {
44-
this(nameDefinition, definition, DATA_EMPTY);
45+
this(nameDefinition, definition, EmptyHelper.INT_ARRAY_EMPTY);
4546
}
4647

47-
private static final int[] DATA_EMPTY = new int[0];
48-
4948
public ErrorState(IErrorStateDefinition nameDefinition, IErrorStateDefinition definition, int[] data) {
5049
EnumErrorType type = definition.getType();
5150
this.data = data;
@@ -57,7 +56,7 @@ public ErrorState(IErrorStateDefinition nameDefinition, IErrorStateDefinition de
5756
}
5857

5958
public ErrorState(NBTTagCompound nbtTagCompound) {
60-
this.data = DATA_EMPTY;
59+
this.data = EmptyHelper.INT_ARRAY_EMPTY;
6160
this.itemError = false;
6261
this.tankError = false;
6362
this.powerError = false;

core/src/main/java/binnie/core/machines/inventory/ComponentTankContainer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import binnie.core.machines.MachineComponent;
2323
import binnie.core.machines.power.ITankMachine;
2424
import binnie.core.machines.power.TankInfo;
25+
import binnie.core.util.EmptyHelper;
2526
import binnie.core.util.NBTUtil;
2627

2728
public class ComponentTankContainer extends MachineComponent implements ITankMachine {
@@ -129,15 +130,13 @@ public IFluidTank getTank(final int index) {
129130
return this.getTanks()[index];
130131
}
131132

132-
private static final IFluidTank[] FLUID_TANKS_EMPTY = new IFluidTank[0];
133-
134133
@Override
135134
public IFluidTank[] getTanks() {
136135
final List<IFluidTank> tankList = new ArrayList<>();
137136
for (final TankSlot tank : this.tanks.values()) {
138137
tankList.add(tank.getTank());
139138
}
140-
return tankList.toArray(FLUID_TANKS_EMPTY);
139+
return tankList.toArray(EmptyHelper.FLUID_TANKS_EMPTY);
141140
}
142141

143142
@Override
@@ -231,7 +230,7 @@ private IFluidTank[] getTanks() {
231230
for (final TankSlot tank : this.tanks.values()) {
232231
ltanks.add(tank.getTank());
233232
}
234-
return ltanks.toArray(FLUID_TANKS_EMPTY);
233+
return ltanks.toArray(EmptyHelper.FLUID_TANKS_EMPTY);
235234
}
236235

237236
private static int getTankIndexToFill(Map<Integer, TankSlot> tanks, @Nullable EnumFacing from, final FluidStack resource) {

core/src/main/java/binnie/core/machines/storage/WindowCompartment.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import binnie.core.gui.window.Panel;
5050
import binnie.core.machines.Machine;
5151
import binnie.core.machines.transfer.TransferRequest;
52+
import binnie.core.util.EmptyHelper;
5253

5354
public class WindowCompartment extends WindowMachine implements IWindowAffectsShiftClick {
5455
private final Map<Panel, Integer> panels;
@@ -63,8 +64,6 @@ public WindowCompartment(final EntityPlayer player, @Nullable final IInventory i
6364
this.currentTab = 0;
6465
}
6566

66-
private static final Integer[] DEFAULT_TABS_EMPTY = new Integer[0];
67-
6867
//TODO: Clean Up, Localise
6968
@Override
7069
@SideOnly(Side.CLIENT)
@@ -76,8 +75,8 @@ public void initialiseClient() {
7675
int x = 16;
7776
final int y = 32;
7877
final ComponentCompartmentInventory inv = machine.getInterface(ComponentCompartmentInventory.class);
79-
Integer[] tabs1 = DEFAULT_TABS_EMPTY;
80-
Integer[] tabs2 = DEFAULT_TABS_EMPTY;
78+
Integer[] tabs1 = EmptyHelper.DEFAULT_TABS_EMPTY;
79+
Integer[] tabs2 = EmptyHelper.DEFAULT_TABS_EMPTY;
8180
if (inv.getTabCount() == 4) {
8281
tabs1 = new Integer[]{0, 1};
8382
tabs2 = new Integer[]{2, 3};

0 commit comments

Comments
 (0)