mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
Localization and refactoring (#77)
* Some refactoring for bee production * Code cleanup * Code cleanup * Added some localization * Fix wrong dropped class * Added some localization * Added some localization * Added some localization * Fix wrong import
This commit is contained in:
1 parent
68bbe7710c
commit
1ea7b62e5f
157 files changed
+3240
-5045
No files matched your search
+37
-35
@@ -12,8 +12,8 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ComponentSequencerFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick {
|
||||
public ComponentSequencerFX(IMachine machine) {
|
||||
public class SequencerComponentFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick {
|
||||
public SequencerComponentFX(IMachine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@@ -62,39 +62,41 @@ public class ComponentSequencerFX extends MachineComponent implements IRender.Ra
|
||||
@Override
|
||||
public void onDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
int ticks = (int) (world.getTotalWorldTime() % 16L);
|
||||
if (ticks == 0 && getUtil().getProcess().isInProgress()) {
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
{
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = 0.012;
|
||||
particleMaxAge = 50;
|
||||
particleGravity = 0.0f;
|
||||
noClip = true;
|
||||
particleScale = 2.0f;
|
||||
|
||||
setParticleIcon((new BinnieIcon[]{
|
||||
Sequencer.fxSeqA,
|
||||
Sequencer.fxSeqG,
|
||||
Sequencer.fxSeqC,
|
||||
Sequencer.fxSeqT
|
||||
})[rand.nextInt(4)].getIcon());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
motionY = 0.012;
|
||||
if (particleAge > 40) {
|
||||
setAlphaF((50 - particleAge) / 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
if (ticks != 0 || !getUtil().getProcess().isInProgress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
{
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = 0.012;
|
||||
particleMaxAge = 50;
|
||||
particleGravity = 0.0f;
|
||||
noClip = true;
|
||||
particleScale = 2.0f;
|
||||
|
||||
setParticleIcon((new BinnieIcon[]{
|
||||
Sequencer.fxSeqA,
|
||||
Sequencer.fxSeqG,
|
||||
Sequencer.fxSeqC,
|
||||
Sequencer.fxSeqT
|
||||
})[rand.nextInt(4)].getIcon());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
motionY = 0.012;
|
||||
if (particleAge > 40) {
|
||||
setAlphaF((50 - particleAge) / 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,8 +10,8 @@ import binnie.genetics.genetics.SequencerItem;
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ComponentSequencerLogic extends ComponentProcess implements IProcess, ComponentInventoryTransfer.ITransferRestockListener {
|
||||
public ComponentSequencerLogic(Machine machine) {
|
||||
public class SequencerComponentLogic extends ComponentProcess implements IProcess, ComponentInventoryTransfer.ITransferRestockListener {
|
||||
public SequencerComponentLogic(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
+8
-8
@@ -15,14 +15,14 @@ import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import binnie.genetics.machine.ComponentGeneticGUI;
|
||||
import binnie.genetics.machine.GeneticMachine;
|
||||
import binnie.genetics.machine.ModuleMachine;
|
||||
import binnie.genetics.machine.PackageGeneticBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PackageSequencer extends GeneticMachine.PackageGeneticBase implements IMachineInformation {
|
||||
private ComponentSequencerLogic logic;
|
||||
public class SequencerPackage extends PackageGeneticBase implements IMachineInformation {
|
||||
private SequencerComponentLogic logic;
|
||||
|
||||
public PackageSequencer() {
|
||||
public SequencerPackage() {
|
||||
super("sequencer", GeneticsTexture.Sequencer, 0xb7ff32, true);
|
||||
Sequencer.fxSeqA = Binnie.Resource.getBlockIcon(Genetics.instance, "fx/sequencer.a");
|
||||
Sequencer.fxSeqG = Binnie.Resource.getBlockIcon(Genetics.instance, "fx/sequencer.g");
|
||||
@@ -41,12 +41,12 @@ public class PackageSequencer extends GeneticMachine.PackageGeneticBase implemen
|
||||
|
||||
inventory.addSlotArray(Sequencer.SLOT_RESERVE, "input");
|
||||
for (InventorySlot slot : inventory.getSlots(Sequencer.SLOT_RESERVE)) {
|
||||
slot.setValidator(new SlotValidatorUnsequenced());
|
||||
slot.setValidator(new UnsequencedSlotValidator());
|
||||
slot.forbidExtraction();
|
||||
}
|
||||
|
||||
InventorySlot slotTarget = inventory.addSlot(Sequencer.SLOT_TARGET_INDEX, "process");
|
||||
slotTarget.setValidator(new SlotValidatorUnsequenced());
|
||||
slotTarget.setValidator(new UnsequencedSlotValidator());
|
||||
slotTarget.setReadOnly();
|
||||
slotTarget.forbidInteraction();
|
||||
|
||||
@@ -58,9 +58,9 @@ public class PackageSequencer extends GeneticMachine.PackageGeneticBase implemen
|
||||
|
||||
new ComponentChargedSlots(machine).addCharge(Sequencer.SLOT_DYE_INDEX);
|
||||
new ComponentPowerReceptor(machine, 10000);
|
||||
new ComponentSequencerFX(machine);
|
||||
new SequencerComponentFX(machine);
|
||||
|
||||
logic = new ComponentSequencerLogic(machine);
|
||||
logic = new SequencerComponentLogic(machine);
|
||||
transfer.setTransferListener(logic);
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ import binnie.genetics.genetics.SequencerItem;
|
||||
import binnie.genetics.machine.ModuleMachine;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class SlotValidatorUnsequenced extends SlotValidator {
|
||||
public SlotValidatorUnsequenced() {
|
||||
public class UnsequencedSlotValidator extends SlotValidator {
|
||||
public UnsequencedSlotValidator() {
|
||||
super(ModuleMachine.IconSequencer);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user