mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-27 15:23:22 +00:00
General Code Maintenance
-might fix https://github.com/GTNewHorizons/NewHorizons/issues/5048 -optimised imports -removed some unused null checks -qualified names, generally made the code more readable Signed-off-by: bartimaeusnek <[email protected]>
This commit is contained in:
1 parent
70064913d8
commit
bab9ad582f
246 files changed
+4892
-5114
No files matched your search
@@ -98,7 +98,7 @@ public abstract class AuraEffect {
|
||||
/**
|
||||
* A EntityEffect AuraEffect class for convenience
|
||||
*/
|
||||
public static abstract class EntityAuraEffect extends AuraEffect {
|
||||
public abstract static class EntityAuraEffect extends AuraEffect {
|
||||
|
||||
@Override
|
||||
public final EffectType getEffectType() {
|
||||
@@ -123,7 +123,7 @@ public abstract class AuraEffect {
|
||||
/**
|
||||
* A BlockEffect AuraEffect class for convenience
|
||||
*/
|
||||
public static abstract class BlockAuraEffect extends AuraEffect {
|
||||
public abstract static class BlockAuraEffect extends AuraEffect {
|
||||
|
||||
@Override
|
||||
public final EffectType getEffectType() {
|
||||
@@ -140,7 +140,7 @@ public abstract class AuraEffect {
|
||||
|
||||
}
|
||||
|
||||
public static enum EffectType {
|
||||
public enum EffectType {
|
||||
|
||||
ENTITY_EFFECT,
|
||||
BLOCK_EFFECT
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class ClickBehavior {
|
||||
|
||||
//TODO not handled as expected.
|
||||
public boolean hasVisCost() {
|
||||
return hasVisCost;
|
||||
return this.hasVisCost;
|
||||
}
|
||||
|
||||
public int getComparatorOutput() {
|
||||
|
||||
@@ -26,54 +26,54 @@ public abstract class GadomancyApi {
|
||||
|
||||
@Deprecated
|
||||
public static boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType){
|
||||
return handler.registerAdditionalGolemType(name, modId, newType);
|
||||
return GadomancyApi.handler.registerAdditionalGolemType(name, modId, newType);
|
||||
}
|
||||
|
||||
public static AdditionalGolemType getAdditionalGolemType(String name) {
|
||||
return handler.getAdditionalGolemType(name);
|
||||
return GadomancyApi.handler.getAdditionalGolemType(name);
|
||||
}
|
||||
|
||||
public static AdditionalGolemType getAdditionalGolemType(EnumGolemType type) {
|
||||
return getAdditionalGolemType(type.name());
|
||||
return GadomancyApi.getAdditionalGolemType(type.name());
|
||||
}
|
||||
|
||||
public static List<AdditionalGolemType> getAdditionalGolemTypes() {
|
||||
return handler.getAdditionalGolemTypes();
|
||||
return GadomancyApi.handler.getAdditionalGolemTypes();
|
||||
}
|
||||
|
||||
public static boolean isAdditionalGolemType(String name) {
|
||||
return getAdditionalGolemType(name) != null;
|
||||
return GadomancyApi.getAdditionalGolemType(name) != null;
|
||||
}
|
||||
|
||||
public static boolean isAdditionalGolemType(EnumGolemType type) {
|
||||
return isAdditionalGolemType(type.name());
|
||||
return GadomancyApi.isAdditionalGolemType(type.name());
|
||||
}
|
||||
|
||||
public static AdditionalGolemCore getAdditionalGolemCore(EntityGolemBase golem) {
|
||||
return handler.getAdditionalGolemCore(golem);
|
||||
return GadomancyApi.handler.getAdditionalGolemCore(golem);
|
||||
}
|
||||
|
||||
public static AdditionalGolemCore getAdditionalGolemCore(ItemStack placer) {
|
||||
return handler.getAdditionalGolemCore(placer);
|
||||
return GadomancyApi.handler.getAdditionalGolemCore(placer);
|
||||
}
|
||||
|
||||
public static void setAdditionalGolemCore(EntityGolemBase golem, AdditionalGolemCore core) {
|
||||
handler.setAdditionalGolemCore(golem, core);
|
||||
GadomancyApi.handler.setAdditionalGolemCore(golem, core);
|
||||
}
|
||||
|
||||
public static boolean registerAdditionalGolemCore(String name, AdditionalGolemCore core) {
|
||||
return handler.registerAdditionalGolemCore(name, core);
|
||||
return GadomancyApi.handler.registerAdditionalGolemCore(name, core);
|
||||
}
|
||||
|
||||
public static void registerAdditionalAuraEffect(Aspect aspect, AuraEffect effect) {
|
||||
handler.registerAdditionalAuraEffect(aspect, effect);
|
||||
GadomancyApi.handler.registerAdditionalAuraEffect(aspect, effect);
|
||||
}
|
||||
|
||||
public static List<AdditionalGolemCore> getAdditionalGolemCores() {
|
||||
return handler.getAdditionalGolemCores();
|
||||
return GadomancyApi.handler.getAdditionalGolemCores();
|
||||
}
|
||||
|
||||
public static void registerClawClickBehavior(ClickBehavior clickBehavior) {
|
||||
handler.registerClawClickBehavior(clickBehavior);
|
||||
GadomancyApi.handler.registerClawClickBehavior(clickBehavior);
|
||||
}
|
||||
}
|
||||
@@ -55,19 +55,19 @@ public abstract class AdditionalGolemType {
|
||||
public abstract ResourceLocation getInvSlotTexture();
|
||||
|
||||
public EnumGolemType getEnumEntry() {
|
||||
return enumEntry;
|
||||
return this.enumEntry;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return enumEntry.name();
|
||||
return this.enumEntry.name();
|
||||
}
|
||||
|
||||
public Item getPlacerItem() {
|
||||
return placerItem;
|
||||
return this.placerItem;
|
||||
}
|
||||
|
||||
public String getModId() {
|
||||
return modId;
|
||||
return this.modId;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class AdditionalGolemCore {
|
||||
public abstract ItemStack getItem();
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -16,28 +16,18 @@ import makeo.gadomancy.client.renderers.block.RenderBlockStoneMachine;
|
||||
import makeo.gadomancy.client.renderers.block.RenderBlockTransparent;
|
||||
import makeo.gadomancy.client.renderers.entity.RenderAdditionalGolemBase;
|
||||
import makeo.gadomancy.client.renderers.entity.RenderEntityAuraCore;
|
||||
import makeo.gadomancy.client.renderers.item.ItemCreativeNodeRenderer;
|
||||
import makeo.gadomancy.client.renderers.item.ItemExNodeRenderer;
|
||||
import makeo.gadomancy.client.renderers.item.ItemJarExtendedNodeRenderer;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderFamiliar;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderRemoteJar;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderStoneMachine;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderTEKnowledgeBook;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderTileEntity;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderTileEntityMulti;
|
||||
import makeo.gadomancy.client.renderers.item.*;
|
||||
import makeo.gadomancy.client.renderers.tile.*;
|
||||
import makeo.gadomancy.client.util.MultiTickEffectDispatcher;
|
||||
import makeo.gadomancy.common.CommonProxy;
|
||||
import makeo.gadomancy.common.blocks.tiles.*;
|
||||
import makeo.gadomancy.common.entities.EntityAuraCore;
|
||||
import makeo.gadomancy.common.entities.EntityItemElement;
|
||||
import makeo.gadomancy.common.entities.EntityPermNoClipItem;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import makeo.gadomancy.common.utils.Injector;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.SimpleReloadableResourceManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -59,8 +49,6 @@ import thaumcraft.common.tiles.TileEldritchCap;
|
||||
import thaumcraft.common.tiles.TileEldritchObelisk;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
|
||||
@@ -82,7 +70,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public void initalize() {
|
||||
super.initalize();
|
||||
|
||||
injectGolemTextures();
|
||||
ClientProxy.injectGolemTextures();
|
||||
|
||||
//Tiles
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileStickyJar.class, new RenderTileStickyJar());
|
||||
@@ -170,9 +158,9 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAuraCore.class, new RenderEntityAuraCore());
|
||||
|
||||
//Blocks
|
||||
RegisteredBlocks.rendererTransparentBlock = registerBlockRenderer(new RenderBlockTransparent());
|
||||
RegisteredBlocks.rendererExtendedNodeJarBlock = registerBlockRenderer(new BlockExtendedNodeJarRenderer());
|
||||
RegisteredBlocks.rendererBlockStoneMachine = registerBlockRenderer(new RenderBlockStoneMachine());
|
||||
RegisteredBlocks.rendererTransparentBlock = this.registerBlockRenderer(new RenderBlockTransparent());
|
||||
RegisteredBlocks.rendererExtendedNodeJarBlock = this.registerBlockRenderer(new BlockExtendedNodeJarRenderer());
|
||||
RegisteredBlocks.rendererBlockStoneMachine = this.registerBlockRenderer(new RenderBlockStoneMachine());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -221,7 +209,7 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
public static void injectGolemTextures() {
|
||||
RenderGolemBase render = unregisterRenderer(EntityGolemBase.class, RenderGolemBase.class);
|
||||
RenderGolemBase render = ClientProxy.unregisterRenderer(EntityGolemBase.class, RenderGolemBase.class);
|
||||
if(render != null) {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGolemBase.class, new RenderAdditionalGolemBase());
|
||||
}
|
||||
@@ -256,6 +244,6 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void runDelayedClientSide(Runnable run) {
|
||||
clientActions.add(run);
|
||||
this.clientActions.add(run);
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,8 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
@@ -35,7 +33,7 @@ public class EffectHandler {
|
||||
public static final Object lockEffects = new Object();
|
||||
|
||||
public static EffectHandler getInstance() {
|
||||
return instance;
|
||||
return EffectHandler.instance;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -43,14 +41,14 @@ public class EffectHandler {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
FXFlow.FXFlowBase.sheduleRender(tessellator);
|
||||
Orbital.sheduleRenders(orbitals, event.partialTicks);
|
||||
FXVortex.sheduleRender(fxVortexes, tessellator, event.partialTicks);
|
||||
Orbital.sheduleRenders(EffectHandler.orbitals, event.partialTicks);
|
||||
FXVortex.sheduleRender(EffectHandler.fxVortexes, tessellator, event.partialTicks);
|
||||
}
|
||||
|
||||
public FXFlow effectFlow(World world, Vector3 origin, FXFlow.EntityFlowProperties properties) {
|
||||
FXFlow flow = new FXFlow(world);
|
||||
flow.applyProperties(properties).setPosition(origin);
|
||||
registerFlow(flow);
|
||||
this.registerFlow(flow);
|
||||
return flow;
|
||||
}
|
||||
|
||||
@@ -59,8 +57,8 @@ public class EffectHandler {
|
||||
@Override
|
||||
public void run() {
|
||||
//System.out.println("register");
|
||||
synchronized (lockEffects) {
|
||||
fxVortexes.add(vortex);
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.fxVortexes.add(vortex);
|
||||
vortex.registered = true;
|
||||
}
|
||||
}
|
||||
@@ -72,8 +70,8 @@ public class EffectHandler {
|
||||
@Override
|
||||
public void run() {
|
||||
//System.out.println("unregister");
|
||||
synchronized (lockEffects) {
|
||||
fxVortexes.remove(vortex);
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.fxVortexes.remove(vortex);
|
||||
vortex.registered = false;
|
||||
}
|
||||
}
|
||||
@@ -84,8 +82,8 @@ public class EffectHandler {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (lockEffects) {
|
||||
fxFlows.add(flow);
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.fxFlows.add(flow);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
@@ -95,8 +93,8 @@ public class EffectHandler {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (lockEffects) {
|
||||
fxFlows.remove(flow);
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.fxFlows.remove(flow);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
@@ -106,8 +104,8 @@ public class EffectHandler {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (lockEffects) {
|
||||
orbitals.add(orbital);
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.orbitals.add(orbital);
|
||||
orbital.registered = true;
|
||||
}
|
||||
}
|
||||
@@ -118,8 +116,8 @@ public class EffectHandler {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (lockEffects) {
|
||||
orbitals.remove(orbital);
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.orbitals.remove(orbital);
|
||||
orbital.registered = false;
|
||||
}
|
||||
}
|
||||
@@ -127,19 +125,19 @@ public class EffectHandler {
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
Orbital.tickOrbitals(orbitals);
|
||||
FXFlow.tickFlows(fxFlows);
|
||||
FXVortex.tickVortexes(fxVortexes);
|
||||
Orbital.tickOrbitals(EffectHandler.orbitals);
|
||||
FXFlow.tickFlows(EffectHandler.fxFlows);
|
||||
FXVortex.tickVortexes(EffectHandler.fxVortexes);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (lockEffects) {
|
||||
orbitals.clear();
|
||||
fxFlows.clear();
|
||||
fxVortexes.clear();
|
||||
synchronized (EffectHandler.lockEffects) {
|
||||
EffectHandler.orbitals.clear();
|
||||
EffectHandler.fxFlows.clear();
|
||||
EffectHandler.fxVortexes.clear();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
@@ -28,12 +28,12 @@ public abstract class EntityFXFlowPolicy {
|
||||
|
||||
private EntityFXFlowPolicy policy;
|
||||
|
||||
private Policies(EntityFXFlowPolicy policy) {
|
||||
Policies(EntityFXFlowPolicy policy) {
|
||||
this.policy = policy;
|
||||
}
|
||||
|
||||
public EntityFXFlowPolicy getPolicy() {
|
||||
return policy;
|
||||
return this.policy;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,13 +42,13 @@ public abstract class EntityFXFlowPolicy {
|
||||
|
||||
@Override
|
||||
public void doSubParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, double lastPosX, double lastPosY, double lastPosZ) {
|
||||
doParticles(fxFlow, policyCounter, posX, posY, posZ, fxFlow.getRand().nextInt(3) + 1);
|
||||
this.doParticles(fxFlow, policyCounter, posX, posY, posZ, fxFlow.getRand().nextInt(3) + 1);
|
||||
}
|
||||
|
||||
public void doParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, int count) {
|
||||
Random rand = fxFlow.getOriginWorld().rand;
|
||||
for (int i = 0; i < count; i++) {
|
||||
Vector3 subOffset = genSubOffset(rand, fxFlow.getSurroundingDistance());
|
||||
Vector3 subOffset = this.genSubOffset(rand, fxFlow.getSurroundingDistance());
|
||||
Color c = (fxFlow.getFadingColor() != null && rand.nextBoolean()) ? fxFlow.getFadingColor() : fxFlow.getColor();
|
||||
FXFlow.FXFlowBase flow = new FXFlow.FXFlowBase(fxFlow.getOriginWorld(), posX + subOffset.getX(), posY + subOffset.getY(), posZ + subOffset.getZ(), c, rand.nextInt(1) + fxFlow.getSurroundingParticleSize(), 6, 240);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(flow);
|
||||
@@ -74,8 +74,8 @@ public abstract class EntityFXFlowPolicy {
|
||||
Vector3 perpendicular = rotationAxis.clone().perpendicular().normalize().multiply(fxFlow.getSurroundingDistance());
|
||||
Vector3 counterSide = perpendicular.clone().rotate(Math.toRadians(180), rotationAxis);
|
||||
|
||||
int currentDividedPolicyTick = policyCounter % TICKS_PER_FULL_TURN;
|
||||
float currentDegree = 360F * (((float) currentDividedPolicyTick) / ((float) TICKS_PER_FULL_TURN));
|
||||
int currentDividedPolicyTick = policyCounter % CircularPolicy.TICKS_PER_FULL_TURN;
|
||||
float currentDegree = 360F * (((float) currentDividedPolicyTick) / ((float) CircularPolicy.TICKS_PER_FULL_TURN));
|
||||
double currentRad = Math.toRadians(currentDegree);
|
||||
|
||||
perpendicular = perpendicular.rotate(currentRad, rotationAxis);
|
||||
|
||||
@@ -13,8 +13,10 @@ import net.minecraft.world.World;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
@@ -29,10 +31,10 @@ public class FXFlow {
|
||||
private Color color;
|
||||
private Color fadingColor;
|
||||
|
||||
private int policyCounter = 0;
|
||||
private int policyCounter;
|
||||
private EntityFXFlowPolicy policy;
|
||||
|
||||
private Vector3 target = null;
|
||||
private Vector3 target;
|
||||
|
||||
private int livingTicks = -1;
|
||||
|
||||
@@ -91,7 +93,7 @@ public class FXFlow {
|
||||
}
|
||||
|
||||
public FXFlow setPosition(Vector3 vec) {
|
||||
return setPosition(vec.getX(), vec.getY(), vec.getZ());
|
||||
return this.setPosition(vec.getX(), vec.getY(), vec.getZ());
|
||||
}
|
||||
|
||||
public void setMotionMultiplier(float motionMultiplier) {
|
||||
@@ -102,9 +104,9 @@ public class FXFlow {
|
||||
this.unmodMotionBufX = motionX;
|
||||
this.unmodMotionBufY = motionY;
|
||||
this.unmodMotionBufZ = motionZ;
|
||||
motionX *= motionMultiplier;
|
||||
motionY *= motionMultiplier;
|
||||
motionZ *= motionMultiplier;
|
||||
motionX *= this.motionMultiplier;
|
||||
motionY *= this.motionMultiplier;
|
||||
motionZ *= this.motionMultiplier;
|
||||
this.motionBufferX = motionX;
|
||||
this.motionBufferY = motionY;
|
||||
this.motionBufferZ = motionZ;
|
||||
@@ -113,8 +115,8 @@ public class FXFlow {
|
||||
|
||||
public void tick() {
|
||||
|
||||
livingTicks--;
|
||||
if (livingTicks <= 0) {
|
||||
this.livingTicks--;
|
||||
if (this.livingTicks <= 0) {
|
||||
EffectHandler.getInstance().unregisterFlow(this);
|
||||
return;
|
||||
}
|
||||
@@ -128,24 +130,24 @@ public class FXFlow {
|
||||
this.posY += this.motionBufferY;
|
||||
this.posZ += this.motionBufferZ;
|
||||
|
||||
policyCounter += 1;
|
||||
doParticles();
|
||||
this.policyCounter += 1;
|
||||
this.doParticles();
|
||||
}
|
||||
|
||||
private void calculateVelocity() {
|
||||
if(target == null) return;
|
||||
if(livingTicks <= 0) return; //Never happens..
|
||||
if(this.target == null) return;
|
||||
if(this.livingTicks <= 0) return; //Never happens..
|
||||
|
||||
Vector3 pos = getPositionVector();
|
||||
double motDirX = target.getX() - pos.getX();
|
||||
double motDirY = target.getY() - pos.getY();
|
||||
double motDirZ = target.getZ() - pos.getZ();
|
||||
Vector3 mot = new Vector3(motDirX, motDirY, motDirZ).divide(livingTicks);
|
||||
setMotion(mot.getX(), mot.getY(), mot.getZ());
|
||||
Vector3 pos = this.getPositionVector();
|
||||
double motDirX = this.target.getX() - pos.getX();
|
||||
double motDirY = this.target.getY() - pos.getY();
|
||||
double motDirZ = this.target.getZ() - pos.getZ();
|
||||
Vector3 mot = new Vector3(motDirX, motDirY, motDirZ).divide(this.livingTicks);
|
||||
this.setMotion(mot.getX(), mot.getY(), mot.getZ());
|
||||
}
|
||||
|
||||
private Vector3 getPositionVector() {
|
||||
return new Vector3(posX, posY, posZ);
|
||||
return new Vector3(this.posX, this.posY, this.posZ);
|
||||
}
|
||||
|
||||
public void setPolicy(EntityFXFlowPolicy policy) {
|
||||
@@ -161,98 +163,98 @@ public class FXFlow {
|
||||
EffectHandler.getInstance().unregisterFlow(this);
|
||||
return;
|
||||
}
|
||||
if(Minecraft.getMinecraft().theWorld.provider.dimensionId != origin.provider.dimensionId) {
|
||||
if(Minecraft.getMinecraft().theWorld.provider.dimensionId != this.origin.provider.dimensionId) {
|
||||
EffectHandler.getInstance().unregisterFlow(this);
|
||||
return;
|
||||
}
|
||||
|
||||
FXFlowBase flow = new FXFlowBase(origin, posX, posY, posZ, color, mainParticleSize, 9, 240);
|
||||
FXFlowBase flow = new FXFlowBase(this.origin, this.posX, this.posY, this.posZ, this.color, this.mainParticleSize, 9, 240);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(flow); //Initial position.
|
||||
double lastPosX = posX - (posX - lastTickPosX) / 2.0D;
|
||||
double lastPosY = posY - (posY - lastTickPosY) / 2.0D;
|
||||
double lastPosZ = posZ - (posZ - lastTickPosZ) / 2.0D;
|
||||
FXFlowBase flow2 = new FXFlowBase(origin, lastPosX, lastPosY, lastPosZ, color, (float) (mainParticleSize * 0.8), 8, 240);
|
||||
double lastPosX = this.posX - (this.posX - this.lastTickPosX) / 2.0D;
|
||||
double lastPosY = this.posY - (this.posY - this.lastTickPosY) / 2.0D;
|
||||
double lastPosZ = this.posZ - (this.posZ - this.lastTickPosZ) / 2.0D;
|
||||
FXFlowBase flow2 = new FXFlowBase(this.origin, lastPosX, lastPosY, lastPosZ, this.color, (float) (this.mainParticleSize * 0.8), 8, 240);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(flow2); //Consistency to last position
|
||||
|
||||
if(policy != null)
|
||||
policy.doSubParticles(this, policyCounter, posX, posY, posZ, lastPosX, lastPosY, lastPosZ);
|
||||
if(this.policy != null)
|
||||
this.policy.doSubParticles(this, this.policyCounter, this.posX, this.posY, this.posZ, lastPosX, lastPosY, lastPosZ);
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
return color;
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public Color getFadingColor() {
|
||||
return fadingColor;
|
||||
return this.fadingColor;
|
||||
}
|
||||
|
||||
public float getSurroundingDistance() {
|
||||
return surroundingDistance;
|
||||
return this.surroundingDistance;
|
||||
}
|
||||
|
||||
public float getSurroundingParticleSize() {
|
||||
return surroundingParticleSize;
|
||||
return this.surroundingParticleSize;
|
||||
}
|
||||
|
||||
public float getMainParticleSize() {
|
||||
return mainParticleSize;
|
||||
return this.mainParticleSize;
|
||||
}
|
||||
|
||||
public float getMotionMultiplier() {
|
||||
return motionMultiplier;
|
||||
return this.motionMultiplier;
|
||||
}
|
||||
|
||||
public boolean isMovementVectorNullLength() {
|
||||
return new Vector3(motionBufferX, motionBufferY, motionBufferZ).lengthSquared() == 0;
|
||||
return new Vector3(this.motionBufferX, this.motionBufferY, this.motionBufferZ).lengthSquared() == 0;
|
||||
}
|
||||
|
||||
public Vector3 getTarget() {
|
||||
return target;
|
||||
return this.target;
|
||||
}
|
||||
|
||||
public World getOriginWorld() {
|
||||
return origin;
|
||||
return this.origin;
|
||||
}
|
||||
|
||||
public Vector3 getMovementVector() {
|
||||
if(isMovementVectorNullLength()) return new Vector3(unmodMotionBufX, unmodMotionBufY, unmodMotionBufZ);
|
||||
return new Vector3(motionBufferX, motionBufferY, motionBufferZ);
|
||||
if(this.isMovementVectorNullLength()) return new Vector3(this.unmodMotionBufX, this.unmodMotionBufY, this.unmodMotionBufZ);
|
||||
return new Vector3(this.motionBufferX, this.motionBufferY, this.motionBufferZ);
|
||||
}
|
||||
|
||||
public Random getRand() {
|
||||
return origin.rand;
|
||||
return this.origin.rand;
|
||||
}
|
||||
|
||||
public FXFlow applyProperties(EntityFlowProperties properties) {
|
||||
if(properties != null) {
|
||||
if(properties.hasTarget) {
|
||||
applyTarget(properties.target);
|
||||
this.applyTarget(properties.target);
|
||||
}
|
||||
if(properties.color != null) {
|
||||
if(properties.fading != null) {
|
||||
setColor(properties.fading);
|
||||
setColor(properties.color);
|
||||
this.setColor(properties.fading);
|
||||
this.setColor(properties.color);
|
||||
} else {
|
||||
setColor(properties.color);
|
||||
this.setColor(properties.color);
|
||||
}
|
||||
} else {
|
||||
if(properties.fading != null) {
|
||||
setColor(properties.fading);
|
||||
this.setColor(properties.fading);
|
||||
}
|
||||
}
|
||||
if(properties.livingTicks != -1)
|
||||
setLivingTicks(properties.livingTicks);
|
||||
this.setLivingTicks(properties.livingTicks);
|
||||
if(properties.mainParticleSize != -1)
|
||||
setMainParticleSize(properties.mainParticleSize);
|
||||
this.setMainParticleSize(properties.mainParticleSize);
|
||||
if(properties.surroundingDistance != -1)
|
||||
setSurroundingDistance(properties.surroundingDistance);
|
||||
this.setSurroundingDistance(properties.surroundingDistance);
|
||||
if(properties.surroundingParticleSize != -1)
|
||||
setSurroundingParticleSize(properties.surroundingParticleSize);
|
||||
this.setSurroundingParticleSize(properties.surroundingParticleSize);
|
||||
if(properties.motionMultiplier != Float.MAX_VALUE) {
|
||||
setMotionMultiplier(properties.motionMultiplier);
|
||||
this.setMotionMultiplier(properties.motionMultiplier);
|
||||
}
|
||||
if(properties.policy != null) {
|
||||
setPolicy(properties.policy);
|
||||
this.setPolicy(properties.policy);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
@@ -385,7 +387,7 @@ public class FXFlow {
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
|
||||
for(FXFlowBase fx : fxQueue) {
|
||||
for(FXFlowBase fx : FXFlowBase.fxQueue) {
|
||||
tessellator.startDrawingQuads();
|
||||
fx.renderEssenceBase(tessellator);
|
||||
tessellator.draw();
|
||||
@@ -399,31 +401,31 @@ public class FXFlow {
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
fxQueue.clear();
|
||||
FXFlowBase.fxQueue.clear();
|
||||
}
|
||||
|
||||
private void renderEssenceBase(Tessellator tessellator) {
|
||||
tessellator.setBrightness(rendBrightness);
|
||||
GL11.glColor4f(partRed , partGreen, partBlue, partAlpha);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
if(particleAge >= particleMaxAge) return;
|
||||
float agescale = (float) particleAge / buffHalfLife;
|
||||
tessellator.setBrightness(this.rendBrightness);
|
||||
GL11.glColor4f(this.partRed, this.partGreen, this.partBlue, this.partAlpha);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(this.texture);
|
||||
if(this.particleAge >= this.particleMaxAge) return;
|
||||
float agescale = (float) this.particleAge / this.buffHalfLife;
|
||||
if(agescale >= 1.0F) agescale = 2 - agescale;
|
||||
particleScale = buffParticleScale * agescale;
|
||||
float f10 = 0.5F * particleScale;
|
||||
float f11 = (float)(prevPosX + (posX - prevPosX) * partialTicks - interpPosX);
|
||||
float f12 = (float)(prevPosY + (posY - prevPosY) * partialTicks - interpPosY);
|
||||
float f13 = (float)(prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ);
|
||||
this.particleScale = this.buffParticleScale * agescale;
|
||||
float f10 = 0.5F * this.particleScale;
|
||||
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * this.partialTicks - EntityFX.interpPosX);
|
||||
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * this.partialTicks - EntityFX.interpPosY);
|
||||
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * this.partialTicks - EntityFX.interpPosZ);
|
||||
|
||||
tessellator.addVertexWithUV(f11 - rendArg1 * f10 - rendArg4 * f10, f12 - rendArg2 * f10, f13 - rendArg3 * f10 - rendArg5 * f10, 0, 1);
|
||||
tessellator.addVertexWithUV(f11 - rendArg1 * f10 + rendArg4 * f10, f12 + rendArg2 * f10, f13 - rendArg3 * f10 + rendArg5 * f10, 1, 1);
|
||||
tessellator.addVertexWithUV(f11 + rendArg1 * f10 + rendArg4 * f10, f12 + rendArg2 * f10, f13 + rendArg3 * f10 + rendArg5 * f10, 1, 0);
|
||||
tessellator.addVertexWithUV(f11 + rendArg1 * f10 - rendArg4 * f10, f12 - rendArg2 * f10, f13 + rendArg3 * f10 - rendArg5 * f10, 0, 0);
|
||||
tessellator.addVertexWithUV(f11 - this.rendArg1 * f10 - this.rendArg4 * f10, f12 - this.rendArg2 * f10, f13 - this.rendArg3 * f10 - this.rendArg5 * f10, 0, 1);
|
||||
tessellator.addVertexWithUV(f11 - this.rendArg1 * f10 + this.rendArg4 * f10, f12 + this.rendArg2 * f10, f13 - this.rendArg3 * f10 + this.rendArg5 * f10, 1, 1);
|
||||
tessellator.addVertexWithUV(f11 + this.rendArg1 * f10 + this.rendArg4 * f10, f12 + this.rendArg2 * f10, f13 + this.rendArg3 * f10 + this.rendArg5 * f10, 1, 0);
|
||||
tessellator.addVertexWithUV(f11 + this.rendArg1 * f10 - this.rendArg4 * f10, f12 - this.rendArg2 * f10, f13 + this.rendArg3 * f10 - this.rendArg5 * f10, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTicks, float par3, float par4, float par5, float par6, float par7) {
|
||||
if(MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity).distance(new Vector3(posX, posY, posZ)) > ModConfig.renderParticleDistance) return;
|
||||
if(MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity).distance(new Vector3(this.posX, this.posY, this.posZ)) > ModConfig.renderParticleDistance) return;
|
||||
|
||||
this.partialTicks = partialTicks;
|
||||
this.rendArg1 = par3;
|
||||
@@ -432,7 +434,7 @@ public class FXFlow {
|
||||
this.rendArg4 = par6;
|
||||
this.rendArg5 = par7;
|
||||
|
||||
fxQueue.add(this);
|
||||
FXFlowBase.fxQueue.add(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ public class FXVortex {
|
||||
public static final ResourceLocation TC_VORTEX_TEXTURE = new ResourceLocation("thaumcraft", "textures/misc/vortex.png");
|
||||
private static final float RAD = (float) (Math.PI * 2);
|
||||
|
||||
private TileEssentiaCompressor parent = null;
|
||||
private TileEssentiaCompressor parent;
|
||||
private long lastUpdateCall;
|
||||
private double x, y, z;
|
||||
public boolean registered = false;
|
||||
public boolean registered;
|
||||
|
||||
public FXVortex(double x, double y, double z) {
|
||||
this.lastUpdateCall = System.currentTimeMillis();
|
||||
@@ -64,26 +64,26 @@ public class FXVortex {
|
||||
float agescale = (float) (ClientHandler.ticks % 800) / 400F;
|
||||
if(agescale >= 1.0F) agescale = 2 - agescale;
|
||||
float size = 0.2F + 0.1F * agescale;
|
||||
if(parent != null) {
|
||||
size += size * (((float) parent.getSizeStage()) * 0.04F);
|
||||
if(this.parent != null) {
|
||||
size += size * (((float) this.parent.getSizeStage()) * 0.04F);
|
||||
}
|
||||
|
||||
float anglePerc = (float) (ClientHandler.ticks % 300) / 300F;
|
||||
float angle = RAD - RAD * anglePerc;
|
||||
float angle = FXVortex.RAD - FXVortex.RAD * anglePerc;
|
||||
|
||||
Vector3 iV = MiscUtils.interpolateEntityPosition(Minecraft.getMinecraft().renderViewEntity, pTicks);
|
||||
if(parent != null && parent.getSizeStage() > 4) {
|
||||
float mult = 0.001F * (parent.getSizeStage() - 4F);
|
||||
if(this.parent != null && this.parent.getSizeStage() > 4) {
|
||||
float mult = 0.001F * (this.parent.getSizeStage() - 4F);
|
||||
Vector3 shake = new Vector3(
|
||||
RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
|
||||
RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
|
||||
RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1));
|
||||
FXVortex.RAND.nextFloat() * mult * (FXVortex.RAND.nextBoolean() ? 1 : -1),
|
||||
FXVortex.RAND.nextFloat() * mult * (FXVortex.RAND.nextBoolean() ? 1 : -1),
|
||||
FXVortex.RAND.nextFloat() * mult * (FXVortex.RAND.nextBoolean() ? 1 : -1));
|
||||
iV.add(shake);
|
||||
}
|
||||
|
||||
GL11.glTranslated(-iV.getX(), -iV.getY(), -iV.getZ());
|
||||
|
||||
UtilsFX.bindTexture(TC_VORTEX_TEXTURE);
|
||||
UtilsFX.bindTexture(FXVortex.TC_VORTEX_TEXTURE);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(220);
|
||||
@@ -95,7 +95,7 @@ public class FXVortex {
|
||||
Vec3 v4 = Vec3.createVectorHelper(arX * size - arYZ * size, -arXZ * size, arZ * size - arXY * size);
|
||||
if (angle != 0.0F) {
|
||||
Vec3 pvec = Vec3.createVectorHelper(iV.getX(), iV.getY(), iV.getZ());
|
||||
Vec3 tvec = Vec3.createVectorHelper(x, y, z);
|
||||
Vec3 tvec = Vec3.createVectorHelper(this.x, this.y, this.z);
|
||||
Vec3 qvec = pvec.subtract(tvec).normalize();
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v1);
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v2);
|
||||
@@ -103,10 +103,10 @@ public class FXVortex {
|
||||
QuadHelper.setAxis(qvec, angle).rotate(v4);
|
||||
}
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
tessellator.addVertexWithUV(x + v1.xCoord, y + v1.yCoord, z + v1.zCoord, 0, 1);
|
||||
tessellator.addVertexWithUV(x + v2.xCoord, y + v2.yCoord, z + v2.zCoord, 1, 1);
|
||||
tessellator.addVertexWithUV(x + v3.xCoord, y + v3.yCoord, z + v3.zCoord, 1, 0);
|
||||
tessellator.addVertexWithUV(x + v4.xCoord, y + v4.yCoord, z + v4.zCoord, 0, 0);
|
||||
tessellator.addVertexWithUV(this.x + v1.xCoord, this.y + v1.yCoord, this.z + v1.zCoord, 0, 1);
|
||||
tessellator.addVertexWithUV(this.x + v2.xCoord, this.y + v2.yCoord, this.z + v2.zCoord, 1, 1);
|
||||
tessellator.addVertexWithUV(this.x + v3.xCoord, this.y + v3.yCoord, this.z + v3.zCoord, 1, 0);
|
||||
tessellator.addVertexWithUV(this.x + v4.xCoord, this.y + v4.yCoord, this.z + v4.zCoord, 0, 0);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
@@ -24,8 +24,8 @@ public final class Orbital {
|
||||
|
||||
private Vector3 center;
|
||||
private final World world;
|
||||
private int orbitalCounter = 0;
|
||||
public boolean registered = false;
|
||||
private int orbitalCounter;
|
||||
public boolean registered;
|
||||
//INFO: Needs to be updated when its "owner" gets rendered.
|
||||
public long lastRenderCall = System.currentTimeMillis();
|
||||
|
||||
@@ -41,48 +41,48 @@ public final class Orbital {
|
||||
}
|
||||
|
||||
public void addOrbitalPoint(OrbitalRenderProperties properties) {
|
||||
if(!orbitals.contains(properties)) {
|
||||
orbitals.add(properties);
|
||||
if(!this.orbitals.contains(properties)) {
|
||||
this.orbitals.add(properties);
|
||||
}
|
||||
}
|
||||
|
||||
public int orbitalsSize() {
|
||||
return orbitals.size();
|
||||
return this.orbitals.size();
|
||||
}
|
||||
|
||||
public void clearOrbitals() {
|
||||
orbitals.clear();
|
||||
this.orbitals.clear();
|
||||
}
|
||||
|
||||
public void doRender(float partialTicks) {
|
||||
if(MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity).distance(center) > ModConfig.renderParticleDistance) return;
|
||||
if(MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity).distance(this.center) > ModConfig.renderParticleDistance) return;
|
||||
if(Minecraft.getMinecraft().isGamePaused()) return;
|
||||
|
||||
for(OrbitalRenderProperties orbitalNode : orbitals) {
|
||||
for(OrbitalRenderProperties orbitalNode : this.orbitals) {
|
||||
Axis axis = orbitalNode.getAxis();
|
||||
int counterOffset = orbitalNode.getOffsetTicks() % orbitalNode.getTicksForFullCircle();
|
||||
|
||||
int currentDividedPolicyTick = (orbitalCounter + counterOffset) % orbitalNode.getTicksForFullCircle();
|
||||
int currentDividedPolicyTick = (this.orbitalCounter + counterOffset) % orbitalNode.getTicksForFullCircle();
|
||||
float currentDegree = 360F * (((float) currentDividedPolicyTick) / ((float) orbitalNode.getTicksForFullCircle()));
|
||||
double currentRad = Math.toRadians(currentDegree);
|
||||
|
||||
Vector3 point = axis.getAxis().clone().perpendicular().normalize().multiply(orbitalNode.getOffset()).rotate(currentRad, axis.getAxis()).add(center);
|
||||
Vector3 point = axis.getAxis().clone().perpendicular().normalize().multiply(orbitalNode.getOffset()).rotate(currentRad, axis.getAxis()).add(this.center);
|
||||
|
||||
if(orbitalNode.getRunnable() != null) {
|
||||
orbitalNode.getRunnable().onRender(world, point, orbitalNode, orbitalCounter, partialTicks);
|
||||
orbitalNode.getRunnable().onRender(this.world, point, orbitalNode, this.orbitalCounter, partialTicks);
|
||||
}
|
||||
|
||||
if(orbitalNode.getParticleSize() <= 0) continue;
|
||||
|
||||
FXFlow.FXFlowBase flow = new FXFlow.FXFlowBase(world, point.getX(), point.getY(), point.getZ(),
|
||||
FXFlow.FXFlowBase flow = new FXFlow.FXFlowBase(this.world, point.getX(), point.getY(), point.getZ(),
|
||||
orbitalNode.getColor(), orbitalNode.getParticleSize(), orbitalNode.getMultiplier(), orbitalNode.getBrightness());
|
||||
|
||||
if(orbitalNode.getSubParticleColor() != null && world.rand.nextInt(3) == 0) {
|
||||
Vector3 subOffset = genSubOffset(world.rand, 0.8F);
|
||||
Color c = (world.rand.nextBoolean()) ? orbitalNode.getSubParticleColor() : orbitalNode.getColor();
|
||||
FXFlow.FXFlowBase flow2 = new FXFlow.FXFlowBase(world,
|
||||
if(orbitalNode.getSubParticleColor() != null && this.world.rand.nextInt(3) == 0) {
|
||||
Vector3 subOffset = this.genSubOffset(this.world.rand, 0.8F);
|
||||
Color c = (this.world.rand.nextBoolean()) ? orbitalNode.getSubParticleColor() : orbitalNode.getColor();
|
||||
FXFlow.FXFlowBase flow2 = new FXFlow.FXFlowBase(this.world,
|
||||
point.getX() + subOffset.getX(), point.getY() + subOffset.getY(), point.getZ() + subOffset.getZ(),
|
||||
c, orbitalNode.getSubSizeRunnable().getSubParticleSize(world.rand, orbitalCounter), 6, 240);
|
||||
c, orbitalNode.getSubSizeRunnable().getSubParticleSize(this.world.rand, this.orbitalCounter), 6, 240);
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(flow2);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public final class Orbital {
|
||||
}
|
||||
|
||||
public void reduceAllOffsets(float percent) {
|
||||
for(OrbitalRenderProperties node : orbitals) {
|
||||
for(OrbitalRenderProperties node : this.orbitals) {
|
||||
node.reduceOffset(percent);
|
||||
}
|
||||
}
|
||||
@@ -116,11 +116,11 @@ public final class Orbital {
|
||||
Axis axis = property.getAxis();
|
||||
int counterOffset = property.getOffsetTicks() % property.getTicksForFullCircle();
|
||||
|
||||
int currentDividedPolicyTick = (orbitalCounter + counterOffset) % property.getTicksForFullCircle();
|
||||
int currentDividedPolicyTick = (this.orbitalCounter + counterOffset) % property.getTicksForFullCircle();
|
||||
float currentDegree = 360F * (((float) currentDividedPolicyTick) / ((float) property.getTicksForFullCircle()));
|
||||
double currentRad = Math.toRadians(currentDegree);
|
||||
|
||||
arr[i] = axis.getAxis().clone().perpendicular().normalize().multiply(property.getOffset()).rotate(currentRad, axis.getAxis()).add(center);
|
||||
arr[i] = axis.getAxis().clone().perpendicular().normalize().multiply(property.getOffset()).rotate(currentRad, axis.getAxis()).add(this.center);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
@@ -155,19 +155,19 @@ public final class Orbital {
|
||||
private double originalOffset, offset;
|
||||
private Color color = Color.WHITE;
|
||||
private int ticksForFullCircle = 40;
|
||||
private OrbitalRenderRunnable runnable = null;
|
||||
private OrbitalRenderRunnable runnable;
|
||||
private int multiplier = 8;
|
||||
private int brightness = 240;
|
||||
private float particleSize = 0.2F;
|
||||
private int offsetTicks = 0;
|
||||
private int offsetTicks;
|
||||
|
||||
private Color subParticleColor = null;
|
||||
private Color subParticleColor;
|
||||
private OrbitalSubSizeRunnable subSizeRunnable;
|
||||
|
||||
public OrbitalRenderProperties(Axis axis, double offsetLength) {
|
||||
this.offset = this.originalOffset = offsetLength;
|
||||
this.axis = axis;
|
||||
this.subSizeRunnable = subSizeRunnableStatic;
|
||||
this.subSizeRunnable = OrbitalRenderProperties.subSizeRunnableStatic;
|
||||
}
|
||||
|
||||
public OrbitalRenderProperties setColor(Color color) {
|
||||
@@ -222,55 +222,55 @@ public final class Orbital {
|
||||
}
|
||||
|
||||
public float getParticleSize() {
|
||||
return particleSize;
|
||||
return this.particleSize;
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
return color;
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public Axis getAxis() {
|
||||
return axis;
|
||||
return this.axis;
|
||||
}
|
||||
|
||||
public double getOffset() {
|
||||
return offset;
|
||||
return this.offset;
|
||||
}
|
||||
|
||||
public Color getSubParticleColor() {
|
||||
return subParticleColor;
|
||||
return this.subParticleColor;
|
||||
}
|
||||
|
||||
public int getTicksForFullCircle() {
|
||||
return ticksForFullCircle;
|
||||
return this.ticksForFullCircle;
|
||||
}
|
||||
|
||||
public OrbitalRenderRunnable getRunnable() {
|
||||
return runnable;
|
||||
return this.runnable;
|
||||
}
|
||||
|
||||
public OrbitalSubSizeRunnable getSubSizeRunnable() {
|
||||
return subSizeRunnable;
|
||||
return this.subSizeRunnable;
|
||||
}
|
||||
|
||||
public int getMultiplier() {
|
||||
return multiplier;
|
||||
return this.multiplier;
|
||||
}
|
||||
|
||||
public int getBrightness() {
|
||||
return brightness;
|
||||
return this.brightness;
|
||||
}
|
||||
|
||||
public int getOffsetTicks() {
|
||||
return offsetTicks;
|
||||
return this.offsetTicks;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class OrbitalSubSizeRunnable {
|
||||
public abstract static class OrbitalSubSizeRunnable {
|
||||
public abstract float getSubParticleSize(Random rand, int orbitalExisted);
|
||||
}
|
||||
|
||||
public static abstract class OrbitalRenderRunnable {
|
||||
public abstract static class OrbitalRenderRunnable {
|
||||
public abstract void onRender(World world, Vector3 selectedPosition, OrbitalRenderProperties properties, int orbitalExisted, float partialTicks);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ public final class Orbital {
|
||||
}
|
||||
|
||||
public Vector3 getAxis() {
|
||||
return axis.clone();
|
||||
return this.axis.clone();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import makeo.gadomancy.client.util.FamiliarHandlerClient;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
|
||||
/**
|
||||
@@ -29,7 +28,7 @@ public class ClientHandler {
|
||||
public void onClientTick(TickEvent.ClientTickEvent event) {
|
||||
if(event.phase.equals(TickEvent.Phase.END) && !Minecraft.getMinecraft().isGamePaused()) {
|
||||
FamiliarHandlerClient.playerTickEvent();
|
||||
ticks++;
|
||||
ClientHandler.ticks++;
|
||||
|
||||
EffectHandler.getInstance().tick();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class FakeArchitectItem extends Item implements IArchitect {
|
||||
|
||||
@Override
|
||||
public ArrayList<BlockCoordinates> getArchitectBlocks(ItemStack stack, World world, int x, int y, int z, int side, EntityPlayer player) {
|
||||
return coords;
|
||||
return this.coords;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,6 +47,7 @@ import thaumcraft.common.items.relics.ItemThaumometer;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
@@ -62,7 +63,7 @@ public class RenderEventHandler {
|
||||
private static final REHWandHandler WAND_HANDLER = new REHWandHandler();
|
||||
private static final FakeArchitectItem ARCHITECT_ITEM = new FakeArchitectItem();
|
||||
|
||||
private Object oldGolemblurb = null;
|
||||
private Object oldGolemblurb;
|
||||
private int blurbId;
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -73,9 +74,9 @@ public class RenderEventHandler {
|
||||
if(golem != null) {
|
||||
AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(golem);
|
||||
if(core != null) {
|
||||
blurbId = core.getBaseCore();
|
||||
String key = "golemblurb." + blurbId + ".text";
|
||||
oldGolemblurb = ResourceReloadListener.languageList.get(key);
|
||||
this.blurbId = core.getBaseCore();
|
||||
String key = "golemblurb." + this.blurbId + ".text";
|
||||
this.oldGolemblurb = ResourceReloadListener.languageList.get(key);
|
||||
ResourceReloadListener.languageList.put(key, StatCollector.translateToLocal(core.getUnlocalizedGuiText()));
|
||||
}
|
||||
}
|
||||
@@ -84,10 +85,10 @@ public class RenderEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void on(GuiScreenEvent.DrawScreenEvent.Post e) {
|
||||
if(oldGolemblurb != null) {
|
||||
String key = "golemblurb." + blurbId + ".text";
|
||||
ResourceReloadListener.languageList.put(key, oldGolemblurb);
|
||||
oldGolemblurb = null;
|
||||
if(this.oldGolemblurb != null) {
|
||||
String key = "golemblurb." + this.blurbId + ".text";
|
||||
ResourceReloadListener.languageList.put(key, this.oldGolemblurb);
|
||||
this.oldGolemblurb = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,10 +112,10 @@ public class RenderEventHandler {
|
||||
}
|
||||
coords.add(new BlockCoordinates(e.target.blockX + dir.offsetX, e.target.blockY + dir.offsetY, e.target.blockZ + dir.offsetZ));
|
||||
|
||||
ARCHITECT_ITEM.setCoords(coords);
|
||||
RenderEventHandler.ARCHITECT_ITEM.setCoords(coords);
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
WAND_HANDLER.handleArchitectOverlay(new ItemStack(ARCHITECT_ITEM), e, e.player.ticksExisted, e.target);
|
||||
RenderEventHandler.WAND_HANDLER.handleArchitectOverlay(new ItemStack(RenderEventHandler.ARCHITECT_ITEM), e, e.player.ticksExisted, e.target);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
@@ -155,15 +156,15 @@ public class RenderEventHandler {
|
||||
MultiTickEffectDispatcher.notifyRenderTick(Minecraft.getMinecraft().theWorld, event.partialTicks);
|
||||
}
|
||||
|
||||
private EntityPlayer current = null;
|
||||
private ItemStack[] armor = null;
|
||||
private EntityPlayer current;
|
||||
private ItemStack[] armor;
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void renderEntityPre(RenderLivingEvent.Pre event) {
|
||||
if(event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer p = (EntityPlayer) event.entity;
|
||||
if(((DataAchromatic)SyncDataHolder.getDataClient("AchromaticData")).isAchromatic((EntityPlayer) event.entity)) {
|
||||
current = p;
|
||||
this.current = p;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
@@ -171,14 +172,14 @@ public class RenderEventHandler {
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
|
||||
}
|
||||
|
||||
armor = p.inventory.armorInventory;
|
||||
p.inventory.armorInventory = new ItemStack[armor.length];
|
||||
System.arraycopy(armor, 0, p.inventory.armorInventory, 0, armor.length);
|
||||
this.armor = p.inventory.armorInventory;
|
||||
p.inventory.armorInventory = new ItemStack[this.armor.length];
|
||||
System.arraycopy(this.armor, 0, p.inventory.armorInventory, 0, this.armor.length);
|
||||
|
||||
boolean changed = false;
|
||||
for(int i = 0; i < armor.length; i++) {
|
||||
if(armor[i] != null && NBTHelper.hasPersistentData(armor[i])) {
|
||||
NBTTagCompound compound = NBTHelper.getPersistentData(armor[i]);
|
||||
for(int i = 0; i < this.armor.length; i++) {
|
||||
if(this.armor[i] != null && NBTHelper.hasPersistentData(this.armor[i])) {
|
||||
NBTTagCompound compound = NBTHelper.getPersistentData(this.armor[i]);
|
||||
if(compound.hasKey("disguise")) {
|
||||
NBTBase base = compound.getTag("disguise");
|
||||
if(base instanceof NBTTagCompound) {
|
||||
@@ -192,8 +193,8 @@ public class RenderEventHandler {
|
||||
}
|
||||
|
||||
if(!changed) {
|
||||
p.inventory.armorInventory = armor;
|
||||
armor = null;
|
||||
p.inventory.armorInventory = this.armor;
|
||||
this.armor = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,15 +203,15 @@ public class RenderEventHandler {
|
||||
public void renderPost(RenderLivingEvent.Post event) {
|
||||
if(event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer p = (EntityPlayer) event.entity;
|
||||
if(armor != null) {
|
||||
p.inventory.armorInventory = armor;
|
||||
if(this.armor != null) {
|
||||
p.inventory.armorInventory = this.armor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
|
||||
public void onSetArmor(RenderPlayerEvent.SetArmorModel event) {
|
||||
if(event.entityPlayer == current) {
|
||||
if(event.entityPlayer == this.current) {
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDepthMask(true);
|
||||
@@ -218,7 +219,7 @@ public class RenderEventHandler {
|
||||
}
|
||||
|
||||
static {
|
||||
ResourceLocation mod = new ResourceLocation(Gadomancy.MODID.toLowerCase() + new String(new byte[] {58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 111, 100, 101, 108, 115, 47, 109, 111, 100, 101, 108, 65, 115, 115, 101, 99, 46, 111, 98, 106}, Charset.forName("UTF-8")));
|
||||
ResourceLocation mod = new ResourceLocation(Gadomancy.MODID.toLowerCase() + new String(new byte[] {58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 111, 100, 101, 108, 115, 47, 109, 111, 100, 101, 108, 65, 115, 115, 101, 99, 46, 111, 98, 106}, StandardCharsets.UTF_8));
|
||||
IModelCustom buf;
|
||||
try {
|
||||
buf = new WavefrontObject("gadomancy:wRender", new GZIPInputStream(Minecraft.getMinecraft().getResourceManager().getResource(mod).getInputStream()));
|
||||
@@ -230,19 +231,19 @@ public class RenderEventHandler {
|
||||
}
|
||||
|
||||
private static final IModelCustom obj;
|
||||
private static final ResourceLocation tex = new ResourceLocation(new String(new byte[] {103, 97, 100, 111, 109, 97, 110, 99, 121, 58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 105, 115, 99, 47, 116, 101, 120, 87, 46, 112, 110, 103}, Charset.forName("UTF-8")));
|
||||
private static final ResourceLocation tex = new ResourceLocation(new String(new byte[] {103, 97, 100, 111, 109, 97, 110, 99, 121, 58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 105, 115, 99, 47, 116, 101, 120, 87, 46, 112, 110, 103}, StandardCharsets.UTF_8));
|
||||
private static int dList = -1;
|
||||
@SubscribeEvent
|
||||
public void onRender(RenderPlayerEvent.Specials.Post event) {
|
||||
if(event.entityPlayer == null) return;
|
||||
if(obj == null) return;
|
||||
if(RenderEventHandler.obj == null) return;
|
||||
if(!CommonProxy.serverOnlineState) return;
|
||||
if(!MiscUtils.isMisunderstood(event.entityPlayer)) return;
|
||||
|
||||
GL11.glColor4f(1f, 1f, 1f, 1f);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(tex);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(RenderEventHandler.tex);
|
||||
boolean f = event.entityPlayer.capabilities.isFlying;
|
||||
double ma = f ? 15 : 5;
|
||||
double r = (ma * (Math.abs((ClientHandler.ticks % 80) - 40) / 40D)) +
|
||||
@@ -250,22 +251,22 @@ public class RenderEventHandler {
|
||||
GL11.glScaled(0.07, 0.07, 0.07);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glTranslated(0, -12.7, 0.7 - (((float) (r / ma)) * (f ? 0.5D : 0.2D)));
|
||||
if(dList == -1) {
|
||||
dList = GLAllocation.generateDisplayLists(2);
|
||||
GL11.glNewList(dList, GL11.GL_COMPILE);
|
||||
obj.renderOnly("wR");
|
||||
if(RenderEventHandler.dList == -1) {
|
||||
RenderEventHandler.dList = GLAllocation.generateDisplayLists(2);
|
||||
GL11.glNewList(RenderEventHandler.dList, GL11.GL_COMPILE);
|
||||
RenderEventHandler.obj.renderOnly("wR");
|
||||
GL11.glEndList();
|
||||
GL11.glNewList(dList + 1, GL11.GL_COMPILE);
|
||||
obj.renderOnly("wL");
|
||||
GL11.glNewList(RenderEventHandler.dList + 1, GL11.GL_COMPILE);
|
||||
RenderEventHandler.obj.renderOnly("wL");
|
||||
GL11.glEndList();
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(20D + r, 0, -1, 0);
|
||||
GL11.glCallList(dList);
|
||||
GL11.glCallList(RenderEventHandler.dList);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(20D + r, 0, 1, 0);
|
||||
GL11.glCallList(dList + 1);
|
||||
GL11.glCallList(RenderEventHandler.dList + 1);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ResourceReloadListener implements IResourceManagerReloadListener {
|
||||
|
||||
public static final ResourceReloadListener instance = new ResourceReloadListener();
|
||||
public static ResourceReloadListener getInstance() {
|
||||
return instance;
|
||||
return ResourceReloadListener.instance;
|
||||
}
|
||||
|
||||
public static Map languageList;
|
||||
@@ -35,29 +35,29 @@ public class ResourceReloadListener implements IResourceManagerReloadListener {
|
||||
Injector inner = new Injector(StringTranslate.class);
|
||||
Object O = inner.getField(Injector.findField(StringTranslate.class, StringTranslate.class));
|
||||
Injector instance = new Injector(O);
|
||||
languageList = instance.getField(instance.findField(Map.class));
|
||||
ResourceReloadListener.languageList = instance.getField(instance.findField(Map.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
reloadGolemResources();
|
||||
this.reloadGolemResources();
|
||||
}
|
||||
|
||||
public void reloadGolemResources() {
|
||||
manipulateLanguageFile();
|
||||
this.manipulateLanguageFile();
|
||||
|
||||
Gadomancy.proxy.runDelayedClientSide(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
registerTextureOverride();
|
||||
ResourceReloadListener.this.registerTextureOverride();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void manipulateLanguageFile() {
|
||||
if(languageList != null) {
|
||||
if(ResourceReloadListener.languageList != null) {
|
||||
for(AdditionalGolemType type : GadomancyApi.getAdditionalGolemTypes()) {
|
||||
languageList.put("item.ItemGolemPlacer." + type.getEnumEntry().ordinal() + ".name",
|
||||
ResourceReloadListener.languageList.put("item.ItemGolemPlacer." + type.getEnumEntry().ordinal() + ".name",
|
||||
StatCollector.translateToLocal(type.getUnlocalizedName() + ".name"));
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,6 @@ public class ResourceReloadListener implements IResourceManagerReloadListener {
|
||||
private static final ResourceLocation TC_GOLEM_GUI_TEXTURE = new ResourceLocation("thaumcraft", "textures/gui/guigolem.png");
|
||||
|
||||
private void registerTextureOverride() {
|
||||
Minecraft.getMinecraft().renderEngine.loadTexture(TC_GOLEM_GUI_TEXTURE, new GolemGuiTexture(TC_GOLEM_GUI_TEXTURE));
|
||||
Minecraft.getMinecraft().renderEngine.loadTexture(ResourceReloadListener.TC_GOLEM_GUI_TEXTURE, new GolemGuiTexture(ResourceReloadListener.TC_GOLEM_GUI_TEXTURE));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package makeo.gadomancy.client.gui;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.TileArcanePackager;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw;
|
||||
import makeo.gadomancy.common.containers.ContainerArcanePackager;
|
||||
import makeo.gadomancy.common.utils.ColorHelper;
|
||||
import makeo.gadomancy.common.utils.SimpleResourceLocation;
|
||||
@@ -41,30 +40,30 @@ public class ArcanePackagerGui extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
if(tile.isInvalid()) {
|
||||
if(this.tile.isInvalid()) {
|
||||
Minecraft.getMinecraft().displayGuiScreen(null);
|
||||
return;
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
this.mc.renderEngine.bindTexture(TEXTURE);
|
||||
this.mc.renderEngine.bindTexture(ArcanePackagerGui.TEXTURE);
|
||||
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
|
||||
if(tile.progress > 0) {
|
||||
drawTexturedModalRect(89, 67, 210, 0, tile.progress, 9);
|
||||
if(this.tile.progress > 0) {
|
||||
this.drawTexturedModalRect(89, 67, 210, 0, this.tile.progress, 9);
|
||||
}
|
||||
|
||||
if(tile.useEssentia) {
|
||||
drawTexturedModalRect(91, 97, 249, 10, 8, 8);
|
||||
if(this.tile.useEssentia) {
|
||||
this.drawTexturedModalRect(91, 97, 249, 10, 8, 8);
|
||||
}
|
||||
|
||||
if(tile.autoStart) {
|
||||
drawTexturedModalRect(91, 110, 249, 10, 8, 8);
|
||||
if(this.tile.autoStart) {
|
||||
this.drawTexturedModalRect(91, 110, 249, 10, 8, 8);
|
||||
}
|
||||
|
||||
if(tile.disguise) {
|
||||
drawTexturedModalRect(91, 123, 249, 10, 8, 8);
|
||||
if(this.tile.disguise) {
|
||||
this.drawTexturedModalRect(91, 123, 249, 10, 8, 8);
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@@ -72,18 +71,18 @@ public class ArcanePackagerGui extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float mouseX, int mouseZ, int par3) {
|
||||
this.mc.renderEngine.bindTexture(TEXTURE);
|
||||
this.mc.renderEngine.bindTexture(ArcanePackagerGui.TEXTURE);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
int var5 = (this.width - this.xSize) / 2;
|
||||
int var6 = (this.height - this.ySize) / 2;
|
||||
drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
|
||||
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
drawString(100, 98, "gadomancy.info.ArcanePackager.useEssentia", tile.useEssentia ? Color.WHITE : Color.GRAY);
|
||||
this.drawString(100, 98, "gadomancy.info.ArcanePackager.useEssentia", this.tile.useEssentia ? Color.WHITE : Color.GRAY);
|
||||
|
||||
drawString(100, 111, "gadomancy.info.ArcanePackager.autoStart", tile.autoStart ? Color.WHITE : Color.GRAY);
|
||||
this.drawString(100, 111, "gadomancy.info.ArcanePackager.autoStart", this.tile.autoStart ? Color.WHITE : Color.GRAY);
|
||||
|
||||
drawString(100, 124, "gadomancy.info.ArcanePackager.disguisePackage", tile.disguise ? Color.WHITE : Color.GRAY);
|
||||
this.drawString(100, 124, "gadomancy.info.ArcanePackager.disguisePackage", this.tile.disguise ? Color.WHITE : Color.GRAY);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
@@ -107,22 +106,22 @@ public class ArcanePackagerGui extends GuiContainer {
|
||||
int checkY = y - baseY - 97;
|
||||
|
||||
if(checkX >= 0 && checkX < 8 && checkY >= 0 && checkY < 8) {
|
||||
tile.useEssentia = !tile.useEssentia;
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, tile.useEssentia ? 0 : 1);
|
||||
this.tile.useEssentia = !this.tile.useEssentia;
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, this.tile.useEssentia ? 0 : 1);
|
||||
}
|
||||
|
||||
checkY = y - baseY - 110;
|
||||
|
||||
if(checkX >= 0 && checkX < 8 && checkY >= 0 && checkY < 8) {
|
||||
tile.autoStart = !tile.autoStart;
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, tile.autoStart ? 2 : 3);
|
||||
this.tile.autoStart = !this.tile.autoStart;
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, this.tile.autoStart ? 2 : 3);
|
||||
}
|
||||
|
||||
checkY = y - baseY - 123;
|
||||
|
||||
if(checkX >= 0 && checkX < 8 && checkY >= 0 && checkY < 8) {
|
||||
tile.disguise = !tile.disguise;
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, tile.disguise ? 4 : 5);
|
||||
this.tile.disguise = !this.tile.disguise;
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, this.tile.disguise ? 4 : 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,20 +56,20 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
for (String s : list) {
|
||||
try {
|
||||
String s2 = s.substring(1);
|
||||
ItemStack is = getFromCache(Integer.parseInt(s2));
|
||||
ItemStack is = GuiResearchRecipe.getFromCache(Integer.parseInt(s2));
|
||||
if (is != null) {
|
||||
AspectList tags = ThaumcraftCraftingManager.getObjectTags(is);
|
||||
tags = ThaumcraftCraftingManager.getBonusTags(is, tags);
|
||||
if ((tags != null) && (tags.size() > 0)) {
|
||||
for (Aspect a : tags.getAspects()) {
|
||||
ArrayList<ItemStack> items = itemMap.get(a.getTag());
|
||||
ArrayList<ItemStack> items = this.itemMap.get(a.getTag());
|
||||
if (items == null) {
|
||||
items = new ArrayList<ItemStack>();
|
||||
}
|
||||
ItemStack is2 = is.copy();
|
||||
is2.stackSize = tags.getAmount(a);
|
||||
items.add(is2);
|
||||
itemMap.put(a.getTag(), items);
|
||||
this.itemMap.put(a.getTag(), items);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
GL11.glTranslatef(var10, var11, 0.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glScalef(1.3F, 1.3F, 1.0F);
|
||||
drawTexturedModalRect(0, 0, 0, 0, this.paneWidth, this.paneHeight);
|
||||
this.drawTexturedModalRect(0, 0, 0, 0, this.paneWidth, this.paneHeight);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
Injector inj = new Injector(this, GuiResearchRecipe.class);
|
||||
@@ -121,7 +121,7 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
if (((current == page) || (current == page + 1)) && (current < maxPages)) {
|
||||
ResearchPage rPage = pages[a];
|
||||
if (rPage instanceof ResearchPageAuraAspects) {
|
||||
drawAuraAspectPagePre(rPage, current % 2, sw, sh, par1, par2, page);
|
||||
this.drawAuraAspectPagePre(rPage, current % 2, sw, sh, par1, par2, page);
|
||||
} else if(rPage != null) {
|
||||
try {
|
||||
Method m = Injector.getMethod("drawPage", GuiResearchRecipe.class, ResearchPage.class, int.class, int.class, int.class, int.class, int.class);
|
||||
@@ -139,17 +139,17 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
}
|
||||
UtilsFX.bindTexture(this.tex1);
|
||||
float bob = MathHelper.sin(this.mc.thePlayer.ticksExisted / 3.0F) * 0.2F + 0.1F;
|
||||
if (!history.isEmpty()) {
|
||||
if (!GuiResearchRecipe.history.isEmpty()) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
drawTexturedModalRectScaled(sw + 118, sh + 189, 38, 202, 20, 12, bob);
|
||||
this.drawTexturedModalRectScaled(sw + 118, sh + 189, 38, 202, 20, 12, bob);
|
||||
}
|
||||
if (page > 0) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
drawTexturedModalRectScaled(sw - 16, sh + 190, 0, 184, 12, 8, bob);
|
||||
this.drawTexturedModalRectScaled(sw - 16, sh + 190, 0, 184, 12, 8, bob);
|
||||
}
|
||||
if (page < maxPages - 2) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
drawTexturedModalRectScaled(sw + 262, sh + 190, 12, 184, 12, 8, bob);
|
||||
this.drawTexturedModalRectScaled(sw + 262, sh + 190, 12, 184, 12, 8, bob);
|
||||
}
|
||||
|
||||
inj.setField("reference", reference);
|
||||
@@ -160,8 +160,8 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
String researchName = Gadomancy.MODID.toUpperCase() + ".AURA_EFFECTS"; //We know the name of that research.
|
||||
researchName = StatCollector.translateToLocal(researchName);
|
||||
if ((thisPage == 0) && (side == 0)) {
|
||||
drawTexturedModalRect(x + 4, y - 13, 24, 184, 96, 4);
|
||||
drawTexturedModalRect(x + 4, y + 4, 24, 184, 96, 4);
|
||||
this.drawTexturedModalRect(x + 4, y - 13, 24, 184, 96, 4);
|
||||
this.drawTexturedModalRect(x + 4, y + 4, 24, 184, 96, 4);
|
||||
int offset = this.fontRendererObj.getStringWidth(researchName);
|
||||
if (offset <= 130) {
|
||||
this.fontRendererObj.drawString(researchName, x + 52 - offset / 2, y - 6, 3158064);
|
||||
@@ -176,7 +176,7 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
y += 25;
|
||||
}
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
|
||||
drawAuraPage(side, x - 8, y - 8, mx, my, page.aspects);
|
||||
this.drawAuraPage(side, x - 8, y - 8, mx, my, page.aspects);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
int tx = x + start;
|
||||
int ty = y + count * 50;
|
||||
if ((mx >= tx) && (my >= ty) && (mx < tx + 40) && (my < ty + 40)) {
|
||||
ArrayList<ItemStack> items = itemMap.get(aspect.getTag());
|
||||
ArrayList<ItemStack> items = this.itemMap.get(aspect.getTag());
|
||||
if ((items != null) && (items.size() > 0)) {
|
||||
int xcount = 0;
|
||||
int ycount = 0;
|
||||
@@ -240,8 +240,8 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.renderEngine, InventoryUtils.cycleItemStack(item), mx + 8 + xcount * 17, 17 * ycount + (my - (4 + items.size() / 8 * 8)));
|
||||
itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.renderEngine, InventoryUtils.cycleItemStack(item), mx + 8 + xcount * 17, 17 * ycount + (my - (4 + items.size() / 8 * 8)));
|
||||
GuiResearchRecipe.itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.renderEngine, InventoryUtils.cycleItemStack(item), mx + 8 + xcount * 17, 17 * ycount + (my - (4 + items.size() / 8 * 8)));
|
||||
GuiResearchRecipe.itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.renderEngine, InventoryUtils.cycleItemStack(item), mx + 8 + xcount * 17, 17 * ycount + (my - (4 + items.size() / 8 * 8)));
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopMatrix();
|
||||
xcount++;
|
||||
|
||||
@@ -33,29 +33,29 @@ public class InfusionClawGui extends GuiContainer {
|
||||
|
||||
public InfusionClawGui(InventoryPlayer playerInv, IInventory clawInv) {
|
||||
super(new ContainerInfusionClaw(playerInv, clawInv));
|
||||
container = (ContainerInfusionClaw) super.inventorySlots;
|
||||
this.container = (ContainerInfusionClaw) super.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
if(((TileInfusionClaw)container.clawInv).isInvalid()) {
|
||||
if(((TileInfusionClaw) this.container.clawInv).isInvalid()) {
|
||||
Minecraft.getMinecraft().displayGuiScreen(null);
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack cursorStack = container.playerInv.getItemStack();
|
||||
if(((TileInfusionClaw)container.clawInv).isRunning() || (cursorStack != null && cursorStack.stackSize > 0 && !container.clawInv.isItemValidForSlot(0, cursorStack))) {
|
||||
ItemStack cursorStack = this.container.playerInv.getItemStack();
|
||||
if(((TileInfusionClaw) this.container.clawInv).isRunning() || (cursorStack != null && cursorStack.stackSize > 0 && !this.container.clawInv.isItemValidForSlot(0, cursorStack))) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1, 1, 1, 0.5f);
|
||||
|
||||
this.mc.renderEngine.bindTexture(BACKGROUND);
|
||||
this.mc.renderEngine.bindTexture(InfusionClawGui.BACKGROUND);
|
||||
float t = this.zLevel;
|
||||
this.zLevel = 200.0F;
|
||||
GL11.glEnable(3042);
|
||||
drawTexturedModalRect(80, 32, 240, 0, 16, 16);
|
||||
this.drawTexturedModalRect(80, 32, 240, 0, 16, 16);
|
||||
GL11.glDisable(3042);
|
||||
this.zLevel = t;
|
||||
|
||||
@@ -67,20 +67,20 @@ public class InfusionClawGui extends GuiContainer {
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
this.mc.renderEngine.bindTexture(BACKGROUND);
|
||||
this.mc.renderEngine.bindTexture(InfusionClawGui.BACKGROUND);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
int var5 = (this.width - this.xSize) / 2;
|
||||
int var6 = (this.height - this.ySize) / 2;
|
||||
drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
|
||||
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int baseX = this.guiLeft;
|
||||
int baseY = this.guiTop;
|
||||
|
||||
drawTexturedModalRect(baseX + 114, baseY + 36, 244, 19, 8, 8);
|
||||
this.drawTexturedModalRect(baseX + 114, baseY + 36, 244, 19, 8, 8);
|
||||
|
||||
boolean isLocked = ((TileInfusionClaw)container.clawInv).isLocked();
|
||||
boolean isLocked = ((TileInfusionClaw) this.container.clawInv).isLocked();
|
||||
if(isLocked) {
|
||||
drawTexturedModalRect(baseX + 114, baseY + 36, 244, 27, 8, 8);
|
||||
this.drawTexturedModalRect(baseX + 114, baseY + 36, 244, 27, 8, 8);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@@ -103,7 +103,7 @@ public class InfusionClawGui extends GuiContainer {
|
||||
int checkY = y - baseY - 36;
|
||||
|
||||
if(checkX >= 0 && checkX < 8 && checkY >= 0 && checkY < 8) {
|
||||
TileInfusionClaw tile = ((TileInfusionClaw)container.clawInv);
|
||||
TileInfusionClaw tile = ((TileInfusionClaw) this.container.clawInv);
|
||||
this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, tile.isLocked() ? 0 : 1);
|
||||
tile.setIsLocked(!tile.isLocked());
|
||||
}
|
||||
|
||||
@@ -28,91 +28,91 @@ public class ModelArcaneDropper extends ModelBase {
|
||||
ModelRenderer shape11;
|
||||
|
||||
public ModelArcaneDropper() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
|
||||
shape1 = new ModelRenderer(this, 44, 0);
|
||||
shape1.addBox(0F, 0F, 0F, 2, 14, 8);
|
||||
shape1.setRotationPoint(-1F, 10F, -4F);
|
||||
shape1.setTextureSize(64, 64);
|
||||
shape1.mirror = true;
|
||||
setRotation(shape1, 0F, 0F, 0F);
|
||||
shape2 = new ModelRenderer(this, 0, 0);
|
||||
shape2.addBox(0F, 0F, 0F, 16, 16, 4);
|
||||
shape2.setRotationPoint(-8F, 8F, 4F);
|
||||
shape2.setTextureSize(64, 64);
|
||||
shape2.mirror = true;
|
||||
setRotation(shape2, 0F, 0F, 0F);
|
||||
shape3 = new ModelRenderer(this, 0, 20);
|
||||
shape3.addBox(0F, 0F, 0F, 16, 16, 4);
|
||||
shape3.setRotationPoint(-8F, 8F, -8F);
|
||||
shape3.setTextureSize(64, 64);
|
||||
shape3.mirror = true;
|
||||
setRotation(shape3, 0F, 0F, 0F);
|
||||
shape4 = new ModelRenderer(this, 34, 22);
|
||||
shape4.addBox(0F, 0F, 0F, 7, 2, 8);
|
||||
shape4.setRotationPoint(1F, 10F, -4F);
|
||||
shape4.setTextureSize(64, 64);
|
||||
shape4.mirror = true;
|
||||
setRotation(shape4, 0F, 0F, 0F);
|
||||
shape5 = new ModelRenderer(this, 34, 32);
|
||||
shape5.addBox(0F, 0F, 0F, 7, 4, 8);
|
||||
shape5.setRotationPoint(1F, 20F, -4F);
|
||||
shape5.setTextureSize(64, 64);
|
||||
shape5.mirror = true;
|
||||
setRotation(shape5, 0F, 0F, 0F);
|
||||
shape6 = new ModelRenderer(this, 34, 52);
|
||||
shape6.addBox(0F, 0F, 0F, 7, 4, 8);
|
||||
shape6.setRotationPoint(-8F, 20F, -4F);
|
||||
shape6.setTextureSize(64, 64);
|
||||
shape6.mirror = true;
|
||||
setRotation(shape6, 0F, 0F, 0F);
|
||||
shape7 = new ModelRenderer(this, 0, 40);
|
||||
shape7.addBox(0F, 0F, 0F, 7, 2, 8);
|
||||
shape7.setRotationPoint(-8F, 10F, -4F);
|
||||
shape7.setTextureSize(64, 64);
|
||||
shape7.mirror = true;
|
||||
setRotation(shape7, 0F, 0F, 0F);
|
||||
shape8 = new ModelRenderer(this, 21, 50);
|
||||
shape8.addBox(0F, 0F, 0F, 5, 2, 8);
|
||||
shape8.setRotationPoint(3F, 8F, -4F);
|
||||
shape8.setTextureSize(64, 64);
|
||||
shape8.mirror = true;
|
||||
setRotation(shape8, 0F, 0F, 0F);
|
||||
shape9 = new ModelRenderer(this, 0, 50);
|
||||
shape9.addBox(0F, 0F, 0F, 5, 2, 8);
|
||||
shape9.setRotationPoint(-8F, 8F, -4F);
|
||||
shape9.setTextureSize(64, 64);
|
||||
shape9.mirror = true;
|
||||
setRotation(shape9, 0F, 0F, 0F);
|
||||
shape10 = new ModelRenderer(this, 0, 61);
|
||||
shape10.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
shape10.setRotationPoint(-3F, 8F, -4F);
|
||||
shape10.setTextureSize(64, 64);
|
||||
shape10.mirror = true;
|
||||
setRotation(shape10, 0F, 0F, 0F);
|
||||
shape11 = new ModelRenderer(this, 14, 61);
|
||||
shape11.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
shape11.setRotationPoint(-3F, 8F, 3F);
|
||||
shape11.setTextureSize(64, 64);
|
||||
shape11.mirror = true;
|
||||
setRotation(shape11, 0F, 0F, 0F);
|
||||
this.shape1 = new ModelRenderer(this, 44, 0);
|
||||
this.shape1.addBox(0F, 0F, 0F, 2, 14, 8);
|
||||
this.shape1.setRotationPoint(-1F, 10F, -4F);
|
||||
this.shape1.setTextureSize(64, 64);
|
||||
this.shape1.mirror = true;
|
||||
this.setRotation(this.shape1, 0F, 0F, 0F);
|
||||
this.shape2 = new ModelRenderer(this, 0, 0);
|
||||
this.shape2.addBox(0F, 0F, 0F, 16, 16, 4);
|
||||
this.shape2.setRotationPoint(-8F, 8F, 4F);
|
||||
this.shape2.setTextureSize(64, 64);
|
||||
this.shape2.mirror = true;
|
||||
this.setRotation(this.shape2, 0F, 0F, 0F);
|
||||
this.shape3 = new ModelRenderer(this, 0, 20);
|
||||
this.shape3.addBox(0F, 0F, 0F, 16, 16, 4);
|
||||
this.shape3.setRotationPoint(-8F, 8F, -8F);
|
||||
this.shape3.setTextureSize(64, 64);
|
||||
this.shape3.mirror = true;
|
||||
this.setRotation(this.shape3, 0F, 0F, 0F);
|
||||
this.shape4 = new ModelRenderer(this, 34, 22);
|
||||
this.shape4.addBox(0F, 0F, 0F, 7, 2, 8);
|
||||
this.shape4.setRotationPoint(1F, 10F, -4F);
|
||||
this.shape4.setTextureSize(64, 64);
|
||||
this.shape4.mirror = true;
|
||||
this.setRotation(this.shape4, 0F, 0F, 0F);
|
||||
this.shape5 = new ModelRenderer(this, 34, 32);
|
||||
this.shape5.addBox(0F, 0F, 0F, 7, 4, 8);
|
||||
this.shape5.setRotationPoint(1F, 20F, -4F);
|
||||
this.shape5.setTextureSize(64, 64);
|
||||
this.shape5.mirror = true;
|
||||
this.setRotation(this.shape5, 0F, 0F, 0F);
|
||||
this.shape6 = new ModelRenderer(this, 34, 52);
|
||||
this.shape6.addBox(0F, 0F, 0F, 7, 4, 8);
|
||||
this.shape6.setRotationPoint(-8F, 20F, -4F);
|
||||
this.shape6.setTextureSize(64, 64);
|
||||
this.shape6.mirror = true;
|
||||
this.setRotation(this.shape6, 0F, 0F, 0F);
|
||||
this.shape7 = new ModelRenderer(this, 0, 40);
|
||||
this.shape7.addBox(0F, 0F, 0F, 7, 2, 8);
|
||||
this.shape7.setRotationPoint(-8F, 10F, -4F);
|
||||
this.shape7.setTextureSize(64, 64);
|
||||
this.shape7.mirror = true;
|
||||
this.setRotation(this.shape7, 0F, 0F, 0F);
|
||||
this.shape8 = new ModelRenderer(this, 21, 50);
|
||||
this.shape8.addBox(0F, 0F, 0F, 5, 2, 8);
|
||||
this.shape8.setRotationPoint(3F, 8F, -4F);
|
||||
this.shape8.setTextureSize(64, 64);
|
||||
this.shape8.mirror = true;
|
||||
this.setRotation(this.shape8, 0F, 0F, 0F);
|
||||
this.shape9 = new ModelRenderer(this, 0, 50);
|
||||
this.shape9.addBox(0F, 0F, 0F, 5, 2, 8);
|
||||
this.shape9.setRotationPoint(-8F, 8F, -4F);
|
||||
this.shape9.setTextureSize(64, 64);
|
||||
this.shape9.mirror = true;
|
||||
this.setRotation(this.shape9, 0F, 0F, 0F);
|
||||
this.shape10 = new ModelRenderer(this, 0, 61);
|
||||
this.shape10.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
this.shape10.setRotationPoint(-3F, 8F, -4F);
|
||||
this.shape10.setTextureSize(64, 64);
|
||||
this.shape10.mirror = true;
|
||||
this.setRotation(this.shape10, 0F, 0F, 0F);
|
||||
this.shape11 = new ModelRenderer(this, 14, 61);
|
||||
this.shape11.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
this.shape11.setRotationPoint(-3F, 8F, 3F);
|
||||
this.shape11.setTextureSize(64, 64);
|
||||
this.shape11.mirror = true;
|
||||
this.setRotation(this.shape11, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape1.render(f5);
|
||||
shape2.render(f5);
|
||||
shape3.render(f5);
|
||||
shape4.render(f5);
|
||||
shape5.render(f5);
|
||||
shape6.render(f5);
|
||||
shape7.render(f5);
|
||||
shape8.render(f5);
|
||||
shape9.render(f5);
|
||||
shape10.render(f5);
|
||||
shape11.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.shape1.render(f5);
|
||||
this.shape2.render(f5);
|
||||
this.shape3.render(f5);
|
||||
this.shape4.render(f5);
|
||||
this.shape5.render(f5);
|
||||
this.shape6.render(f5);
|
||||
this.shape7.render(f5);
|
||||
this.shape8.render(f5);
|
||||
this.shape9.render(f5);
|
||||
this.shape10.render(f5);
|
||||
this.shape11.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -24,77 +24,77 @@ public class ModelArcanePackager extends ModelBase {
|
||||
ModelRenderer shape9;
|
||||
|
||||
public ModelArcanePackager() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
|
||||
shape1 = new ModelRenderer(this, 0, 0);
|
||||
shape1.addBox(0F, 0F, 0F, 16, 3, 16);
|
||||
shape1.setRotationPoint(-8F, 21F, -8F);
|
||||
shape1.setTextureSize(64, 64);
|
||||
shape1.mirror = true;
|
||||
setRotation(shape1, 0F, 0F, 0F);
|
||||
shape2 = new ModelRenderer(this, 0, 20);
|
||||
shape2.addBox(0F, 0F, 0F, 16, 3, 16);
|
||||
shape2.setRotationPoint(-8F, 12F, -8F);
|
||||
shape2.setTextureSize(64, 64);
|
||||
shape2.mirror = true;
|
||||
setRotation(shape2, 0F, 0F, 0F);
|
||||
shape3 = new ModelRenderer(this, 0, 40);
|
||||
shape3.addBox(0F, 0F, 0F, 1, 5, 5);
|
||||
shape3.setRotationPoint(7F, 13.5F, -2.5F);
|
||||
shape3.setTextureSize(64, 64);
|
||||
shape3.mirror = true;
|
||||
setRotation(shape3, 0F, 0F, 0F);
|
||||
shape4 = new ModelRenderer(this, 13, 40);
|
||||
shape4.addBox(-2F, 0F, 0F, 3, 2, 2);
|
||||
shape4.setRotationPoint(7F, 15F, -1F);
|
||||
shape4.setTextureSize(64, 64);
|
||||
shape4.mirror = true;
|
||||
setRotation(shape4, 0F, 0F, 0.7853982F);
|
||||
shape5 = new ModelRenderer(this, 13, 45);
|
||||
shape5.addBox(0.3F, 0.12F, 0F, 1, 1, 2);
|
||||
shape5.setRotationPoint(6F, 16F, -1F);
|
||||
shape5.setTextureSize(64, 64);
|
||||
shape5.mirror = true;
|
||||
setRotation(shape5, 0F, 0F, 0F);
|
||||
shape6 = new ModelRenderer(this, 7, 40);
|
||||
shape6.addBox(0F, 0F, 0F, 1, 6, 16);
|
||||
shape6.setRotationPoint(-8F, 15F, -8F);
|
||||
shape6.setTextureSize(64, 64);
|
||||
shape6.mirror = true;
|
||||
setRotation(shape6, 0F, 0F, 0F);
|
||||
shape7 = new ModelRenderer(this, 24, 40);
|
||||
shape7.addBox(0F, 0F, 0F, 1, 6, 16);
|
||||
shape7.setRotationPoint(7F, 15F, -8F);
|
||||
shape7.setTextureSize(64, 64);
|
||||
shape7.mirror = true;
|
||||
setRotation(shape7, 0F, 0F, 0F);
|
||||
shape8 = new ModelRenderer(this, -9, 56);
|
||||
shape8.addBox(0F, 0F, 0F, 16, 6, 0);
|
||||
shape8.setRotationPoint(-8F, 15F, 8F);
|
||||
shape8.setTextureSize(64, 64);
|
||||
shape8.mirror = true;
|
||||
setRotation(shape8, 0F, 0F, 0F);
|
||||
shape9 = new ModelRenderer(this, 6, 55);
|
||||
shape9.addBox(0F, 0F, 0F, 16, 6, 1);
|
||||
shape9.setRotationPoint(-8F, 15F, -8F);
|
||||
shape9.setTextureSize(64, 64);
|
||||
shape9.mirror = true;
|
||||
setRotation(shape9, 0F, 0F, 0F);
|
||||
this.shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.shape1.addBox(0F, 0F, 0F, 16, 3, 16);
|
||||
this.shape1.setRotationPoint(-8F, 21F, -8F);
|
||||
this.shape1.setTextureSize(64, 64);
|
||||
this.shape1.mirror = true;
|
||||
this.setRotation(this.shape1, 0F, 0F, 0F);
|
||||
this.shape2 = new ModelRenderer(this, 0, 20);
|
||||
this.shape2.addBox(0F, 0F, 0F, 16, 3, 16);
|
||||
this.shape2.setRotationPoint(-8F, 12F, -8F);
|
||||
this.shape2.setTextureSize(64, 64);
|
||||
this.shape2.mirror = true;
|
||||
this.setRotation(this.shape2, 0F, 0F, 0F);
|
||||
this.shape3 = new ModelRenderer(this, 0, 40);
|
||||
this.shape3.addBox(0F, 0F, 0F, 1, 5, 5);
|
||||
this.shape3.setRotationPoint(7F, 13.5F, -2.5F);
|
||||
this.shape3.setTextureSize(64, 64);
|
||||
this.shape3.mirror = true;
|
||||
this.setRotation(this.shape3, 0F, 0F, 0F);
|
||||
this.shape4 = new ModelRenderer(this, 13, 40);
|
||||
this.shape4.addBox(-2F, 0F, 0F, 3, 2, 2);
|
||||
this.shape4.setRotationPoint(7F, 15F, -1F);
|
||||
this.shape4.setTextureSize(64, 64);
|
||||
this.shape4.mirror = true;
|
||||
this.setRotation(this.shape4, 0F, 0F, 0.7853982F);
|
||||
this.shape5 = new ModelRenderer(this, 13, 45);
|
||||
this.shape5.addBox(0.3F, 0.12F, 0F, 1, 1, 2);
|
||||
this.shape5.setRotationPoint(6F, 16F, -1F);
|
||||
this.shape5.setTextureSize(64, 64);
|
||||
this.shape5.mirror = true;
|
||||
this.setRotation(this.shape5, 0F, 0F, 0F);
|
||||
this.shape6 = new ModelRenderer(this, 7, 40);
|
||||
this.shape6.addBox(0F, 0F, 0F, 1, 6, 16);
|
||||
this.shape6.setRotationPoint(-8F, 15F, -8F);
|
||||
this.shape6.setTextureSize(64, 64);
|
||||
this.shape6.mirror = true;
|
||||
this.setRotation(this.shape6, 0F, 0F, 0F);
|
||||
this.shape7 = new ModelRenderer(this, 24, 40);
|
||||
this.shape7.addBox(0F, 0F, 0F, 1, 6, 16);
|
||||
this.shape7.setRotationPoint(7F, 15F, -8F);
|
||||
this.shape7.setTextureSize(64, 64);
|
||||
this.shape7.mirror = true;
|
||||
this.setRotation(this.shape7, 0F, 0F, 0F);
|
||||
this.shape8 = new ModelRenderer(this, -9, 56);
|
||||
this.shape8.addBox(0F, 0F, 0F, 16, 6, 0);
|
||||
this.shape8.setRotationPoint(-8F, 15F, 8F);
|
||||
this.shape8.setTextureSize(64, 64);
|
||||
this.shape8.mirror = true;
|
||||
this.setRotation(this.shape8, 0F, 0F, 0F);
|
||||
this.shape9 = new ModelRenderer(this, 6, 55);
|
||||
this.shape9.addBox(0F, 0F, 0F, 16, 6, 1);
|
||||
this.shape9.setRotationPoint(-8F, 15F, -8F);
|
||||
this.shape9.setTextureSize(64, 64);
|
||||
this.shape9.mirror = true;
|
||||
this.setRotation(this.shape9, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape1.render(f5);
|
||||
shape2.render(f5);
|
||||
shape3.render(f5);
|
||||
shape4.render(f5);
|
||||
shape5.render(f5);
|
||||
shape9.render(f5);
|
||||
shape6.render(f5);
|
||||
shape7.render(f5);
|
||||
shape8.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.shape1.render(f5);
|
||||
this.shape2.render(f5);
|
||||
this.shape3.render(f5);
|
||||
this.shape4.render(f5);
|
||||
this.shape5.render(f5);
|
||||
this.shape9.render(f5);
|
||||
this.shape6.render(f5);
|
||||
this.shape7.render(f5);
|
||||
this.shape8.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -24,120 +24,120 @@ public class ModelAuraPylon extends ModelBase {
|
||||
|
||||
public ModelAuraPylon()
|
||||
{
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 32;
|
||||
|
||||
outerpylon = new ModelRenderer(this, 0, 0);
|
||||
outerpylon.addBox(0F, 0F, 0F, 2, 16, 2);
|
||||
outerpylon.setRotationPoint(5F, 8F, 5F);
|
||||
outerpylon.setTextureSize(32, 32);
|
||||
outerpylon.mirror = true;
|
||||
setRotation(outerpylon, 0F, 0F, 0F);
|
||||
lowerconduit = new ModelRenderer(this, 9, 0);
|
||||
lowerconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
lowerconduit.setRotationPoint(6F, 20F, 7F);
|
||||
lowerconduit.setTextureSize(32, 32);
|
||||
lowerconduit.mirror = true;
|
||||
setRotation(lowerconduit, 0F, 2.356194F, 0F);
|
||||
inlower1 = new ModelRenderer(this, 9, 3);
|
||||
inlower1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
inlower1.setRotationPoint(3F, 20F, 3F);
|
||||
inlower1.setTextureSize(32, 32);
|
||||
inlower1.mirror = true;
|
||||
setRotation(inlower1, 0F, 3.141593F, 0F);
|
||||
inlower2 = new ModelRenderer(this, 9, 11);
|
||||
inlower2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
inlower2.setRotationPoint(3F, 20F, 3F);
|
||||
inlower2.setTextureSize(32, 32);
|
||||
inlower2.mirror = true;
|
||||
setRotation(inlower2, 0F, 3.141593F, 0F);
|
||||
upperconduit = new ModelRenderer(this, 9, 0);
|
||||
upperconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
upperconduit.setRotationPoint(6F, 11F, 7F);
|
||||
upperconduit.setTextureSize(32, 32);
|
||||
upperconduit.mirror = true;
|
||||
setRotation(upperconduit, 0F, 2.356194F, 0F);
|
||||
inupper2 = new ModelRenderer(this, 9, 11);
|
||||
inupper2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
inupper2.setRotationPoint(3F, 11F, 3F);
|
||||
inupper2.setTextureSize(32, 32);
|
||||
inupper2.mirror = true;
|
||||
setRotation(inupper2, 0F, 3.141593F, 0F);
|
||||
inupper1 = new ModelRenderer(this, 9, 3);
|
||||
inupper1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
inupper1.setRotationPoint(3F, 11F, 3F);
|
||||
inupper1.setTextureSize(32, 32);
|
||||
inupper1.mirror = true;
|
||||
setRotation(inupper1, 0F, 3.141593F, 0F);
|
||||
outuppersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
outuppersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
outuppersmooth1.setRotationPoint(6F, 11F, 6F);
|
||||
outuppersmooth1.setTextureSize(32, 32);
|
||||
outuppersmooth1.mirror = true;
|
||||
setRotation(outuppersmooth1, 0F, 2.792527F, 0F);
|
||||
outuppersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
outuppersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
outuppersmooth2.setRotationPoint(5F, 11F, 7F);
|
||||
outuppersmooth2.setTextureSize(32, 32);
|
||||
outuppersmooth2.mirror = true;
|
||||
setRotation(outuppersmooth2, 0F, 1.919862F, 0F);
|
||||
inuppersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
inuppersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
inuppersmooth1.setRotationPoint(2F, 11F, 2F);
|
||||
inuppersmooth1.setTextureSize(32, 32);
|
||||
inuppersmooth1.mirror = true;
|
||||
setRotation(inuppersmooth1, 0F, 0.3490659F, 0F);
|
||||
inuppersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
inuppersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
inuppersmooth2.setRotationPoint(1F, 11F, 3F);
|
||||
inuppersmooth2.setTextureSize(32, 32);
|
||||
inuppersmooth2.mirror = true;
|
||||
setRotation(inuppersmooth2, 0F, 1.22173F, 0F);
|
||||
outlowersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
outlowersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
outlowersmooth2.setRotationPoint(5F, 20F, 7F);
|
||||
outlowersmooth2.setTextureSize(32, 32);
|
||||
outlowersmooth2.mirror = true;
|
||||
setRotation(outlowersmooth2, 0F, 1.919862F, 0F);
|
||||
outlowersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
outlowersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
outlowersmooth1.setRotationPoint(6F, 20F, 6F);
|
||||
outlowersmooth1.setTextureSize(32, 32);
|
||||
outlowersmooth1.mirror = true;
|
||||
setRotation(outlowersmooth1, 0F, 2.792527F, 0F);
|
||||
inlowersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
inlowersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
inlowersmooth1.setRotationPoint(2F, 20F, 2F);
|
||||
inlowersmooth1.setTextureSize(32, 32);
|
||||
inlowersmooth1.mirror = true;
|
||||
setRotation(inlowersmooth1, 0F, 0.3490659F, 0F);
|
||||
inlowersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
inlowersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
inlowersmooth2.setRotationPoint(1F, 20F, 3F);
|
||||
inlowersmooth2.setTextureSize(32, 32);
|
||||
inlowersmooth2.mirror = true;
|
||||
setRotation(inlowersmooth2, 0F, 1.22173F, 0F);
|
||||
this.outerpylon = new ModelRenderer(this, 0, 0);
|
||||
this.outerpylon.addBox(0F, 0F, 0F, 2, 16, 2);
|
||||
this.outerpylon.setRotationPoint(5F, 8F, 5F);
|
||||
this.outerpylon.setTextureSize(32, 32);
|
||||
this.outerpylon.mirror = true;
|
||||
this.setRotation(this.outerpylon, 0F, 0F, 0F);
|
||||
this.lowerconduit = new ModelRenderer(this, 9, 0);
|
||||
this.lowerconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
this.lowerconduit.setRotationPoint(6F, 20F, 7F);
|
||||
this.lowerconduit.setTextureSize(32, 32);
|
||||
this.lowerconduit.mirror = true;
|
||||
this.setRotation(this.lowerconduit, 0F, 2.356194F, 0F);
|
||||
this.inlower1 = new ModelRenderer(this, 9, 3);
|
||||
this.inlower1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
this.inlower1.setRotationPoint(3F, 20F, 3F);
|
||||
this.inlower1.setTextureSize(32, 32);
|
||||
this.inlower1.mirror = true;
|
||||
this.setRotation(this.inlower1, 0F, 3.141593F, 0F);
|
||||
this.inlower2 = new ModelRenderer(this, 9, 11);
|
||||
this.inlower2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
this.inlower2.setRotationPoint(3F, 20F, 3F);
|
||||
this.inlower2.setTextureSize(32, 32);
|
||||
this.inlower2.mirror = true;
|
||||
this.setRotation(this.inlower2, 0F, 3.141593F, 0F);
|
||||
this.upperconduit = new ModelRenderer(this, 9, 0);
|
||||
this.upperconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
this.upperconduit.setRotationPoint(6F, 11F, 7F);
|
||||
this.upperconduit.setTextureSize(32, 32);
|
||||
this.upperconduit.mirror = true;
|
||||
this.setRotation(this.upperconduit, 0F, 2.356194F, 0F);
|
||||
this.inupper2 = new ModelRenderer(this, 9, 11);
|
||||
this.inupper2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
this.inupper2.setRotationPoint(3F, 11F, 3F);
|
||||
this.inupper2.setTextureSize(32, 32);
|
||||
this.inupper2.mirror = true;
|
||||
this.setRotation(this.inupper2, 0F, 3.141593F, 0F);
|
||||
this.inupper1 = new ModelRenderer(this, 9, 3);
|
||||
this.inupper1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
this.inupper1.setRotationPoint(3F, 11F, 3F);
|
||||
this.inupper1.setTextureSize(32, 32);
|
||||
this.inupper1.mirror = true;
|
||||
this.setRotation(this.inupper1, 0F, 3.141593F, 0F);
|
||||
this.outuppersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
this.outuppersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
this.outuppersmooth1.setRotationPoint(6F, 11F, 6F);
|
||||
this.outuppersmooth1.setTextureSize(32, 32);
|
||||
this.outuppersmooth1.mirror = true;
|
||||
this.setRotation(this.outuppersmooth1, 0F, 2.792527F, 0F);
|
||||
this.outuppersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
this.outuppersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
this.outuppersmooth2.setRotationPoint(5F, 11F, 7F);
|
||||
this.outuppersmooth2.setTextureSize(32, 32);
|
||||
this.outuppersmooth2.mirror = true;
|
||||
this.setRotation(this.outuppersmooth2, 0F, 1.919862F, 0F);
|
||||
this.inuppersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
this.inuppersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
this.inuppersmooth1.setRotationPoint(2F, 11F, 2F);
|
||||
this.inuppersmooth1.setTextureSize(32, 32);
|
||||
this.inuppersmooth1.mirror = true;
|
||||
this.setRotation(this.inuppersmooth1, 0F, 0.3490659F, 0F);
|
||||
this.inuppersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
this.inuppersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
this.inuppersmooth2.setRotationPoint(1F, 11F, 3F);
|
||||
this.inuppersmooth2.setTextureSize(32, 32);
|
||||
this.inuppersmooth2.mirror = true;
|
||||
this.setRotation(this.inuppersmooth2, 0F, 1.22173F, 0F);
|
||||
this.outlowersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
this.outlowersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
this.outlowersmooth2.setRotationPoint(5F, 20F, 7F);
|
||||
this.outlowersmooth2.setTextureSize(32, 32);
|
||||
this.outlowersmooth2.mirror = true;
|
||||
this.setRotation(this.outlowersmooth2, 0F, 1.919862F, 0F);
|
||||
this.outlowersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
this.outlowersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
this.outlowersmooth1.setRotationPoint(6F, 20F, 6F);
|
||||
this.outlowersmooth1.setTextureSize(32, 32);
|
||||
this.outlowersmooth1.mirror = true;
|
||||
this.setRotation(this.outlowersmooth1, 0F, 2.792527F, 0F);
|
||||
this.inlowersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
this.inlowersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
this.inlowersmooth1.setRotationPoint(2F, 20F, 2F);
|
||||
this.inlowersmooth1.setTextureSize(32, 32);
|
||||
this.inlowersmooth1.mirror = true;
|
||||
this.setRotation(this.inlowersmooth1, 0F, 0.3490659F, 0F);
|
||||
this.inlowersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
this.inlowersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
this.inlowersmooth2.setRotationPoint(1F, 20F, 3F);
|
||||
this.inlowersmooth2.setTextureSize(32, 32);
|
||||
this.inlowersmooth2.mirror = true;
|
||||
this.setRotation(this.inlowersmooth2, 0F, 1.22173F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
outerpylon.render(f5);
|
||||
lowerconduit.render(f5);
|
||||
inlower1.render(f5);
|
||||
inlower2.render(f5);
|
||||
upperconduit.render(f5);
|
||||
inupper2.render(f5);
|
||||
inupper1.render(f5);
|
||||
outuppersmooth1.render(f5);
|
||||
outuppersmooth2.render(f5);
|
||||
inuppersmooth1.render(f5);
|
||||
inuppersmooth2.render(f5);
|
||||
outlowersmooth2.render(f5);
|
||||
outlowersmooth1.render(f5);
|
||||
inlowersmooth1.render(f5);
|
||||
inlowersmooth2.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.outerpylon.render(f5);
|
||||
this.lowerconduit.render(f5);
|
||||
this.inlower1.render(f5);
|
||||
this.inlower2.render(f5);
|
||||
this.upperconduit.render(f5);
|
||||
this.inupper2.render(f5);
|
||||
this.inupper1.render(f5);
|
||||
this.outuppersmooth1.render(f5);
|
||||
this.outuppersmooth2.render(f5);
|
||||
this.inuppersmooth1.render(f5);
|
||||
this.inuppersmooth2.render(f5);
|
||||
this.outlowersmooth2.render(f5);
|
||||
this.outlowersmooth1.render(f5);
|
||||
this.inlowersmooth1.render(f5);
|
||||
this.inlowersmooth2.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
|
||||
@@ -29,161 +29,161 @@ public class ModelAuraPylonBottom extends ModelBase {
|
||||
ModelRenderer pylonorn4;
|
||||
|
||||
public ModelAuraPylonBottom() {
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 32;
|
||||
|
||||
outerpylon = new ModelRenderer(this, 0, 0);
|
||||
outerpylon.addBox(0F, 0F, 0F, 2, 16, 2);
|
||||
outerpylon.setRotationPoint(5F, 8F, 5F);
|
||||
outerpylon.setTextureSize(64, 32);
|
||||
outerpylon.mirror = true;
|
||||
setRotation(outerpylon, 0F, 0F, 0F);
|
||||
lowerconduit = new ModelRenderer(this, 9, 0);
|
||||
lowerconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
lowerconduit.setRotationPoint(6F, 20F, 7F);
|
||||
lowerconduit.setTextureSize(64, 32);
|
||||
lowerconduit.mirror = true;
|
||||
setRotation(lowerconduit, 0F, 2.356194F, 0F);
|
||||
inlower1 = new ModelRenderer(this, 9, 3);
|
||||
inlower1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
inlower1.setRotationPoint(3F, 20F, 3F);
|
||||
inlower1.setTextureSize(64, 32);
|
||||
inlower1.mirror = true;
|
||||
setRotation(inlower1, 0F, 3.141593F, 0F);
|
||||
inlower2 = new ModelRenderer(this, 9, 11);
|
||||
inlower2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
inlower2.setRotationPoint(3F, 20F, 3F);
|
||||
inlower2.setTextureSize(64, 32);
|
||||
inlower2.mirror = true;
|
||||
setRotation(inlower2, 0F, 3.141593F, 0F);
|
||||
upperconduit = new ModelRenderer(this, 9, 0);
|
||||
upperconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
upperconduit.setRotationPoint(6F, 11F, 7F);
|
||||
upperconduit.setTextureSize(64, 32);
|
||||
upperconduit.mirror = true;
|
||||
setRotation(upperconduit, 0F, 2.356194F, 0F);
|
||||
inupper2 = new ModelRenderer(this, 9, 11);
|
||||
inupper2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
inupper2.setRotationPoint(3F, 11F, 3F);
|
||||
inupper2.setTextureSize(64, 32);
|
||||
inupper2.mirror = true;
|
||||
setRotation(inupper2, 0F, 3.141593F, 0F);
|
||||
inupper1 = new ModelRenderer(this, 9, 3);
|
||||
inupper1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
inupper1.setRotationPoint(3F, 11F, 3F);
|
||||
inupper1.setTextureSize(64, 32);
|
||||
inupper1.mirror = true;
|
||||
setRotation(inupper1, 0F, 3.141593F, 0F);
|
||||
outuppersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
outuppersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
outuppersmooth1.setRotationPoint(6F, 11F, 6F);
|
||||
outuppersmooth1.setTextureSize(64, 32);
|
||||
outuppersmooth1.mirror = true;
|
||||
setRotation(outuppersmooth1, 0F, 2.792527F, 0F);
|
||||
outuppersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
outuppersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
outuppersmooth2.setRotationPoint(5F, 11F, 7F);
|
||||
outuppersmooth2.setTextureSize(64, 32);
|
||||
outuppersmooth2.mirror = true;
|
||||
setRotation(outuppersmooth2, 0F, 1.919862F, 0F);
|
||||
inuppersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
inuppersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
inuppersmooth1.setRotationPoint(2F, 11F, 2F);
|
||||
inuppersmooth1.setTextureSize(64, 32);
|
||||
inuppersmooth1.mirror = true;
|
||||
setRotation(inuppersmooth1, 0F, 0.3490659F, 0F);
|
||||
inuppersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
inuppersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
inuppersmooth2.setRotationPoint(1F, 11F, 3F);
|
||||
inuppersmooth2.setTextureSize(64, 32);
|
||||
inuppersmooth2.mirror = true;
|
||||
setRotation(inuppersmooth2, 0F, 1.22173F, 0F);
|
||||
outlowersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
outlowersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
outlowersmooth2.setRotationPoint(5F, 20F, 7F);
|
||||
outlowersmooth2.setTextureSize(64, 32);
|
||||
outlowersmooth2.mirror = true;
|
||||
setRotation(outlowersmooth2, 0F, 1.919862F, 0F);
|
||||
outlowersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
outlowersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
outlowersmooth1.setRotationPoint(6F, 20F, 6F);
|
||||
outlowersmooth1.setTextureSize(64, 32);
|
||||
outlowersmooth1.mirror = true;
|
||||
setRotation(outlowersmooth1, 0F, 2.792527F, 0F);
|
||||
inlowersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
inlowersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
inlowersmooth1.setRotationPoint(2F, 20F, 2F);
|
||||
inlowersmooth1.setTextureSize(64, 32);
|
||||
inlowersmooth1.mirror = true;
|
||||
setRotation(inlowersmooth1, 0F, 0.3490659F, 0F);
|
||||
inlowersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
inlowersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
inlowersmooth2.setRotationPoint(1F, 20F, 3F);
|
||||
inlowersmooth2.setTextureSize(64, 32);
|
||||
inlowersmooth2.mirror = true;
|
||||
setRotation(inlowersmooth2, 0F, 1.22173F, 0F);
|
||||
base = new ModelRenderer(this, 0, 22);
|
||||
base.addBox(0F, 0F, 0F, 8, 2, 8);
|
||||
base.setRotationPoint(0F, 22F, 0F);
|
||||
base.setTextureSize(64, 32);
|
||||
base.mirror = true;
|
||||
setRotation(base, 0F, 0F, 0F);
|
||||
baseornament = new ModelRenderer(this, 16, 14);
|
||||
baseornament.addBox(0F, 0F, 0.2F, 2, 1, 6);
|
||||
baseornament.setRotationPoint(-1F, 21F, 0F);
|
||||
baseornament.setTextureSize(64, 32);
|
||||
baseornament.mirror = true;
|
||||
setRotation(baseornament, -0.1630138F, 0F, 0F);
|
||||
pylonorn1 = new ModelRenderer(this, 18, 3);
|
||||
pylonorn1.addBox(0F, -4F, 0F, 2, 3, 1);
|
||||
pylonorn1.setRotationPoint(5F, 23.5F, 7F);
|
||||
pylonorn1.setTextureSize(64, 32);
|
||||
pylonorn1.mirror = true;
|
||||
setRotation(pylonorn1, 0.2617994F, 0F, 0F);
|
||||
pylonorn2 = new ModelRenderer(this, 18, 3);
|
||||
pylonorn2.addBox(0F, -4F, -1F, 2, 3, 1);
|
||||
pylonorn2.setRotationPoint(5F, 23.5F, 5F);
|
||||
pylonorn2.setTextureSize(64, 32);
|
||||
pylonorn2.mirror = true;
|
||||
setRotation(pylonorn2, -0.2617994F, 0F, 0F);
|
||||
pylonorn3 = new ModelRenderer(this, 18, 3);
|
||||
pylonorn3.addBox(0F, -4F, 0F, 2, 3, 1);
|
||||
pylonorn3.setRotationPoint(7F, 23.5F, 7F);
|
||||
pylonorn3.setTextureSize(64, 32);
|
||||
pylonorn3.mirror = true;
|
||||
setRotation(pylonorn3, 0.2617994F, 1.570796F, 0F);
|
||||
pylonorn4 = new ModelRenderer(this, 18, 3);
|
||||
pylonorn4.addBox(0F, -4F, 0F, 2, 3, 1);
|
||||
pylonorn4.setRotationPoint(5F, 23.5F, 5F);
|
||||
pylonorn4.setTextureSize(64, 32);
|
||||
pylonorn4.mirror = true;
|
||||
setRotation(pylonorn4, 0.2617994F, -1.570796F, 0F);
|
||||
this.outerpylon = new ModelRenderer(this, 0, 0);
|
||||
this.outerpylon.addBox(0F, 0F, 0F, 2, 16, 2);
|
||||
this.outerpylon.setRotationPoint(5F, 8F, 5F);
|
||||
this.outerpylon.setTextureSize(64, 32);
|
||||
this.outerpylon.mirror = true;
|
||||
this.setRotation(this.outerpylon, 0F, 0F, 0F);
|
||||
this.lowerconduit = new ModelRenderer(this, 9, 0);
|
||||
this.lowerconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
this.lowerconduit.setRotationPoint(6F, 20F, 7F);
|
||||
this.lowerconduit.setTextureSize(64, 32);
|
||||
this.lowerconduit.mirror = true;
|
||||
this.setRotation(this.lowerconduit, 0F, 2.356194F, 0F);
|
||||
this.inlower1 = new ModelRenderer(this, 9, 3);
|
||||
this.inlower1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
this.inlower1.setRotationPoint(3F, 20F, 3F);
|
||||
this.inlower1.setTextureSize(64, 32);
|
||||
this.inlower1.mirror = true;
|
||||
this.setRotation(this.inlower1, 0F, 3.141593F, 0F);
|
||||
this.inlower2 = new ModelRenderer(this, 9, 11);
|
||||
this.inlower2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
this.inlower2.setRotationPoint(3F, 20F, 3F);
|
||||
this.inlower2.setTextureSize(64, 32);
|
||||
this.inlower2.mirror = true;
|
||||
this.setRotation(this.inlower2, 0F, 3.141593F, 0F);
|
||||
this.upperconduit = new ModelRenderer(this, 9, 0);
|
||||
this.upperconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
this.upperconduit.setRotationPoint(6F, 11F, 7F);
|
||||
this.upperconduit.setTextureSize(64, 32);
|
||||
this.upperconduit.mirror = true;
|
||||
this.setRotation(this.upperconduit, 0F, 2.356194F, 0F);
|
||||
this.inupper2 = new ModelRenderer(this, 9, 11);
|
||||
this.inupper2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
this.inupper2.setRotationPoint(3F, 11F, 3F);
|
||||
this.inupper2.setTextureSize(64, 32);
|
||||
this.inupper2.mirror = true;
|
||||
this.setRotation(this.inupper2, 0F, 3.141593F, 0F);
|
||||
this.inupper1 = new ModelRenderer(this, 9, 3);
|
||||
this.inupper1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
this.inupper1.setRotationPoint(3F, 11F, 3F);
|
||||
this.inupper1.setTextureSize(64, 32);
|
||||
this.inupper1.mirror = true;
|
||||
this.setRotation(this.inupper1, 0F, 3.141593F, 0F);
|
||||
this.outuppersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
this.outuppersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
this.outuppersmooth1.setRotationPoint(6F, 11F, 6F);
|
||||
this.outuppersmooth1.setTextureSize(64, 32);
|
||||
this.outuppersmooth1.mirror = true;
|
||||
this.setRotation(this.outuppersmooth1, 0F, 2.792527F, 0F);
|
||||
this.outuppersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
this.outuppersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
this.outuppersmooth2.setRotationPoint(5F, 11F, 7F);
|
||||
this.outuppersmooth2.setTextureSize(64, 32);
|
||||
this.outuppersmooth2.mirror = true;
|
||||
this.setRotation(this.outuppersmooth2, 0F, 1.919862F, 0F);
|
||||
this.inuppersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
this.inuppersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
this.inuppersmooth1.setRotationPoint(2F, 11F, 2F);
|
||||
this.inuppersmooth1.setTextureSize(64, 32);
|
||||
this.inuppersmooth1.mirror = true;
|
||||
this.setRotation(this.inuppersmooth1, 0F, 0.3490659F, 0F);
|
||||
this.inuppersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
this.inuppersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
this.inuppersmooth2.setRotationPoint(1F, 11F, 3F);
|
||||
this.inuppersmooth2.setTextureSize(64, 32);
|
||||
this.inuppersmooth2.mirror = true;
|
||||
this.setRotation(this.inuppersmooth2, 0F, 1.22173F, 0F);
|
||||
this.outlowersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
this.outlowersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
this.outlowersmooth2.setRotationPoint(5F, 20F, 7F);
|
||||
this.outlowersmooth2.setTextureSize(64, 32);
|
||||
this.outlowersmooth2.mirror = true;
|
||||
this.setRotation(this.outlowersmooth2, 0F, 1.919862F, 0F);
|
||||
this.outlowersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
this.outlowersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
this.outlowersmooth1.setRotationPoint(6F, 20F, 6F);
|
||||
this.outlowersmooth1.setTextureSize(64, 32);
|
||||
this.outlowersmooth1.mirror = true;
|
||||
this.setRotation(this.outlowersmooth1, 0F, 2.792527F, 0F);
|
||||
this.inlowersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
this.inlowersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
this.inlowersmooth1.setRotationPoint(2F, 20F, 2F);
|
||||
this.inlowersmooth1.setTextureSize(64, 32);
|
||||
this.inlowersmooth1.mirror = true;
|
||||
this.setRotation(this.inlowersmooth1, 0F, 0.3490659F, 0F);
|
||||
this.inlowersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
this.inlowersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
this.inlowersmooth2.setRotationPoint(1F, 20F, 3F);
|
||||
this.inlowersmooth2.setTextureSize(64, 32);
|
||||
this.inlowersmooth2.mirror = true;
|
||||
this.setRotation(this.inlowersmooth2, 0F, 1.22173F, 0F);
|
||||
this.base = new ModelRenderer(this, 0, 22);
|
||||
this.base.addBox(0F, 0F, 0F, 8, 2, 8);
|
||||
this.base.setRotationPoint(0F, 22F, 0F);
|
||||
this.base.setTextureSize(64, 32);
|
||||
this.base.mirror = true;
|
||||
this.setRotation(this.base, 0F, 0F, 0F);
|
||||
this.baseornament = new ModelRenderer(this, 16, 14);
|
||||
this.baseornament.addBox(0F, 0F, 0.2F, 2, 1, 6);
|
||||
this.baseornament.setRotationPoint(-1F, 21F, 0F);
|
||||
this.baseornament.setTextureSize(64, 32);
|
||||
this.baseornament.mirror = true;
|
||||
this.setRotation(this.baseornament, -0.1630138F, 0F, 0F);
|
||||
this.pylonorn1 = new ModelRenderer(this, 18, 3);
|
||||
this.pylonorn1.addBox(0F, -4F, 0F, 2, 3, 1);
|
||||
this.pylonorn1.setRotationPoint(5F, 23.5F, 7F);
|
||||
this.pylonorn1.setTextureSize(64, 32);
|
||||
this.pylonorn1.mirror = true;
|
||||
this.setRotation(this.pylonorn1, 0.2617994F, 0F, 0F);
|
||||
this.pylonorn2 = new ModelRenderer(this, 18, 3);
|
||||
this.pylonorn2.addBox(0F, -4F, -1F, 2, 3, 1);
|
||||
this.pylonorn2.setRotationPoint(5F, 23.5F, 5F);
|
||||
this.pylonorn2.setTextureSize(64, 32);
|
||||
this.pylonorn2.mirror = true;
|
||||
this.setRotation(this.pylonorn2, -0.2617994F, 0F, 0F);
|
||||
this.pylonorn3 = new ModelRenderer(this, 18, 3);
|
||||
this.pylonorn3.addBox(0F, -4F, 0F, 2, 3, 1);
|
||||
this.pylonorn3.setRotationPoint(7F, 23.5F, 7F);
|
||||
this.pylonorn3.setTextureSize(64, 32);
|
||||
this.pylonorn3.mirror = true;
|
||||
this.setRotation(this.pylonorn3, 0.2617994F, 1.570796F, 0F);
|
||||
this.pylonorn4 = new ModelRenderer(this, 18, 3);
|
||||
this.pylonorn4.addBox(0F, -4F, 0F, 2, 3, 1);
|
||||
this.pylonorn4.setRotationPoint(5F, 23.5F, 5F);
|
||||
this.pylonorn4.setTextureSize(64, 32);
|
||||
this.pylonorn4.mirror = true;
|
||||
this.setRotation(this.pylonorn4, 0.2617994F, -1.570796F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
outerpylon.render(f5);
|
||||
lowerconduit.render(f5);
|
||||
inlower1.render(f5);
|
||||
inlower2.render(f5);
|
||||
upperconduit.render(f5);
|
||||
inupper2.render(f5);
|
||||
inupper1.render(f5);
|
||||
outuppersmooth1.render(f5);
|
||||
outuppersmooth2.render(f5);
|
||||
inuppersmooth1.render(f5);
|
||||
inuppersmooth2.render(f5);
|
||||
outlowersmooth2.render(f5);
|
||||
outlowersmooth1.render(f5);
|
||||
inlowersmooth1.render(f5);
|
||||
inlowersmooth2.render(f5);
|
||||
base.render(f5);
|
||||
baseornament.render(f5);
|
||||
pylonorn1.render(f5);
|
||||
pylonorn2.render(f5);
|
||||
pylonorn3.render(f5);
|
||||
pylonorn4.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.outerpylon.render(f5);
|
||||
this.lowerconduit.render(f5);
|
||||
this.inlower1.render(f5);
|
||||
this.inlower2.render(f5);
|
||||
this.upperconduit.render(f5);
|
||||
this.inupper2.render(f5);
|
||||
this.inupper1.render(f5);
|
||||
this.outuppersmooth1.render(f5);
|
||||
this.outuppersmooth2.render(f5);
|
||||
this.inuppersmooth1.render(f5);
|
||||
this.inuppersmooth2.render(f5);
|
||||
this.outlowersmooth2.render(f5);
|
||||
this.outlowersmooth1.render(f5);
|
||||
this.inlowersmooth1.render(f5);
|
||||
this.inlowersmooth2.render(f5);
|
||||
this.base.render(f5);
|
||||
this.baseornament.render(f5);
|
||||
this.pylonorn1.render(f5);
|
||||
this.pylonorn2.render(f5);
|
||||
this.pylonorn3.render(f5);
|
||||
this.pylonorn4.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -20,92 +20,92 @@ public class ModelAuraPylonTop extends ModelBase {
|
||||
|
||||
public ModelAuraPylonTop()
|
||||
{
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 32;
|
||||
|
||||
outerpylon = new ModelRenderer(this, 0, 0);
|
||||
outerpylon.addBox(0F, 0F, 0F, 2, 8, 2);
|
||||
outerpylon.setRotationPoint(5F, 16F, 5F);
|
||||
outerpylon.setTextureSize(64, 32);
|
||||
outerpylon.mirror = true;
|
||||
setRotation(outerpylon, 0F, 0F, 0F);
|
||||
lowerconduit = new ModelRenderer(this, 9, 0);
|
||||
lowerconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
lowerconduit.setRotationPoint(6F, 20F, 7F);
|
||||
lowerconduit.setTextureSize(64, 32);
|
||||
lowerconduit.mirror = true;
|
||||
setRotation(lowerconduit, 0F, 2.356194F, 0F);
|
||||
inlower1 = new ModelRenderer(this, 9, 3);
|
||||
inlower1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
inlower1.setRotationPoint(3F, 20F, 3F);
|
||||
inlower1.setTextureSize(64, 32);
|
||||
inlower1.mirror = true;
|
||||
setRotation(inlower1, 0F, 3.141593F, 0F);
|
||||
inlower2 = new ModelRenderer(this, 9, 11);
|
||||
inlower2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
inlower2.setRotationPoint(3F, 20F, 3F);
|
||||
inlower2.setTextureSize(64, 32);
|
||||
inlower2.mirror = true;
|
||||
setRotation(inlower2, 0F, 3.141593F, 0F);
|
||||
outlowersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
outlowersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
outlowersmooth2.setRotationPoint(5F, 20F, 7F);
|
||||
outlowersmooth2.setTextureSize(64, 32);
|
||||
outlowersmooth2.mirror = true;
|
||||
setRotation(outlowersmooth2, 0F, 1.919862F, 0F);
|
||||
outlowersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
outlowersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
outlowersmooth1.setRotationPoint(6F, 20F, 6F);
|
||||
outlowersmooth1.setTextureSize(64, 32);
|
||||
outlowersmooth1.mirror = true;
|
||||
setRotation(outlowersmooth1, 0F, 2.792527F, 0F);
|
||||
inlowersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
inlowersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
inlowersmooth1.setRotationPoint(2F, 20F, 2F);
|
||||
inlowersmooth1.setTextureSize(64, 32);
|
||||
inlowersmooth1.mirror = true;
|
||||
setRotation(inlowersmooth1, 0F, 0.3490659F, 0F);
|
||||
inlowersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
inlowersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
inlowersmooth2.setRotationPoint(1F, 20F, 3F);
|
||||
inlowersmooth2.setTextureSize(64, 32);
|
||||
inlowersmooth2.mirror = true;
|
||||
setRotation(inlowersmooth2, 0F, 1.22173F, 0F);
|
||||
outerpylonmiddle1 = new ModelRenderer(this, 0, 11);
|
||||
outerpylonmiddle1.addBox(0F, 0F, 0F, 2, 4, 1);
|
||||
outerpylonmiddle1.setRotationPoint(5F, 12F, 5F);
|
||||
outerpylonmiddle1.setTextureSize(64, 32);
|
||||
outerpylonmiddle1.mirror = true;
|
||||
setRotation(outerpylonmiddle1, 0F, 0F, 0F);
|
||||
outerpylonmiddle2 = new ModelRenderer(this, 0, 17);
|
||||
outerpylonmiddle2.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
outerpylonmiddle2.setRotationPoint(5F, 12F, 6F);
|
||||
outerpylonmiddle2.setTextureSize(64, 32);
|
||||
outerpylonmiddle2.mirror = true;
|
||||
setRotation(outerpylonmiddle2, 0F, 0F, 0F);
|
||||
outerpylonupper = new ModelRenderer(this, 5, 17);
|
||||
outerpylonupper.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
outerpylonupper.setRotationPoint(5F, 8F, 5F);
|
||||
outerpylonupper.setTextureSize(64, 32);
|
||||
outerpylonupper.mirror = true;
|
||||
setRotation(outerpylonupper, 0F, 0F, 0F);
|
||||
this.outerpylon = new ModelRenderer(this, 0, 0);
|
||||
this.outerpylon.addBox(0F, 0F, 0F, 2, 8, 2);
|
||||
this.outerpylon.setRotationPoint(5F, 16F, 5F);
|
||||
this.outerpylon.setTextureSize(64, 32);
|
||||
this.outerpylon.mirror = true;
|
||||
this.setRotation(this.outerpylon, 0F, 0F, 0F);
|
||||
this.lowerconduit = new ModelRenderer(this, 9, 0);
|
||||
this.lowerconduit.addBox(0F, 0F, 0.2F, 6, 1, 1);
|
||||
this.lowerconduit.setRotationPoint(6F, 20F, 7F);
|
||||
this.lowerconduit.setTextureSize(64, 32);
|
||||
this.lowerconduit.mirror = true;
|
||||
this.setRotation(this.lowerconduit, 0F, 2.356194F, 0F);
|
||||
this.inlower1 = new ModelRenderer(this, 9, 3);
|
||||
this.inlower1.addBox(0F, 0F, 0F, 1, 1, 3);
|
||||
this.inlower1.setRotationPoint(3F, 20F, 3F);
|
||||
this.inlower1.setTextureSize(64, 32);
|
||||
this.inlower1.mirror = true;
|
||||
this.setRotation(this.inlower1, 0F, 3.141593F, 0F);
|
||||
this.inlower2 = new ModelRenderer(this, 9, 11);
|
||||
this.inlower2.addBox(0F, 0F, 0F, 3, 1, 1);
|
||||
this.inlower2.setRotationPoint(3F, 20F, 3F);
|
||||
this.inlower2.setTextureSize(64, 32);
|
||||
this.inlower2.mirror = true;
|
||||
this.setRotation(this.inlower2, 0F, 3.141593F, 0F);
|
||||
this.outlowersmooth2 = new ModelRenderer(this, 9, 8);
|
||||
this.outlowersmooth2.addBox(0F, 0F, 0.1F, 2, 1, 1);
|
||||
this.outlowersmooth2.setRotationPoint(5F, 20F, 7F);
|
||||
this.outlowersmooth2.setTextureSize(64, 32);
|
||||
this.outlowersmooth2.mirror = true;
|
||||
this.setRotation(this.outlowersmooth2, 0F, 1.919862F, 0F);
|
||||
this.outlowersmooth1 = new ModelRenderer(this, 9, 8);
|
||||
this.outlowersmooth1.addBox(-0.5F, 0F, 0.2F, 2, 1, 1);
|
||||
this.outlowersmooth1.setRotationPoint(6F, 20F, 6F);
|
||||
this.outlowersmooth1.setTextureSize(64, 32);
|
||||
this.outlowersmooth1.mirror = true;
|
||||
this.setRotation(this.outlowersmooth1, 0F, 2.792527F, 0F);
|
||||
this.inlowersmooth1 = new ModelRenderer(this, 9, 14);
|
||||
this.inlowersmooth1.addBox(0.25F, 0F, -0.5F, 1, 1, 2);
|
||||
this.inlowersmooth1.setRotationPoint(2F, 20F, 2F);
|
||||
this.inlowersmooth1.setTextureSize(64, 32);
|
||||
this.inlowersmooth1.mirror = true;
|
||||
this.setRotation(this.inlowersmooth1, 0F, 0.3490659F, 0F);
|
||||
this.inlowersmooth2 = new ModelRenderer(this, 9, 14);
|
||||
this.inlowersmooth2.addBox(0.15F, 0F, 0.3F, 1, 1, 2);
|
||||
this.inlowersmooth2.setRotationPoint(1F, 20F, 3F);
|
||||
this.inlowersmooth2.setTextureSize(64, 32);
|
||||
this.inlowersmooth2.mirror = true;
|
||||
this.setRotation(this.inlowersmooth2, 0F, 1.22173F, 0F);
|
||||
this.outerpylonmiddle1 = new ModelRenderer(this, 0, 11);
|
||||
this.outerpylonmiddle1.addBox(0F, 0F, 0F, 2, 4, 1);
|
||||
this.outerpylonmiddle1.setRotationPoint(5F, 12F, 5F);
|
||||
this.outerpylonmiddle1.setTextureSize(64, 32);
|
||||
this.outerpylonmiddle1.mirror = true;
|
||||
this.setRotation(this.outerpylonmiddle1, 0F, 0F, 0F);
|
||||
this.outerpylonmiddle2 = new ModelRenderer(this, 0, 17);
|
||||
this.outerpylonmiddle2.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
this.outerpylonmiddle2.setRotationPoint(5F, 12F, 6F);
|
||||
this.outerpylonmiddle2.setTextureSize(64, 32);
|
||||
this.outerpylonmiddle2.mirror = true;
|
||||
this.setRotation(this.outerpylonmiddle2, 0F, 0F, 0F);
|
||||
this.outerpylonupper = new ModelRenderer(this, 5, 17);
|
||||
this.outerpylonupper.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
this.outerpylonupper.setRotationPoint(5F, 8F, 5F);
|
||||
this.outerpylonupper.setTextureSize(64, 32);
|
||||
this.outerpylonupper.mirror = true;
|
||||
this.setRotation(this.outerpylonupper, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
outerpylon.render(f5);
|
||||
lowerconduit.render(f5);
|
||||
inlower1.render(f5);
|
||||
inlower2.render(f5);
|
||||
outlowersmooth2.render(f5);
|
||||
outlowersmooth1.render(f5);
|
||||
inlowersmooth1.render(f5);
|
||||
inlowersmooth2.render(f5);
|
||||
outerpylonmiddle1.render(f5);
|
||||
outerpylonmiddle2.render(f5);
|
||||
outerpylonupper.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.outerpylon.render(f5);
|
||||
this.lowerconduit.render(f5);
|
||||
this.inlower1.render(f5);
|
||||
this.inlower2.render(f5);
|
||||
this.outlowersmooth2.render(f5);
|
||||
this.outlowersmooth1.render(f5);
|
||||
this.inlowersmooth1.render(f5);
|
||||
this.inlowersmooth2.render(f5);
|
||||
this.outerpylonmiddle1.render(f5);
|
||||
this.outerpylonmiddle2.render(f5);
|
||||
this.outerpylonupper.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
|
||||
@@ -29,105 +29,105 @@ public class ModelBlockProtector extends ModelBase {
|
||||
ModelRenderer Shape13;
|
||||
|
||||
public ModelBlockProtector() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
|
||||
Shape1 = new ModelRenderer(this, 0, 0);
|
||||
Shape1.addBox(0F, 0F, 0F, 16, 3, 16);
|
||||
Shape1.setRotationPoint(-8F, 21F, -8F);
|
||||
Shape1.setTextureSize(64, 64);
|
||||
Shape1.mirror = true;
|
||||
setRotation(Shape1, 0F, 0F, 0F);
|
||||
Shape2 = new ModelRenderer(this, 0, 20);
|
||||
Shape2.addBox(0F, 0F, 0F, 4, 1, 1);
|
||||
Shape2.setRotationPoint(-2F, 20F, -8F);
|
||||
Shape2.setTextureSize(64, 64);
|
||||
Shape2.mirror = true;
|
||||
setRotation(Shape2, 0F, 0F, 0F);
|
||||
Shape3 = new ModelRenderer(this, 11, 20);
|
||||
Shape3.addBox(0F, 0F, 0F, 4, 1, 3);
|
||||
Shape3.setRotationPoint(-2F, 20F, -7F);
|
||||
Shape3.setTextureSize(64, 64);
|
||||
Shape3.mirror = true;
|
||||
setRotation(Shape3, -0.3490659F, 0F, 0F);
|
||||
Shape4 = new ModelRenderer(this, 27, 20);
|
||||
Shape4.addBox(0F, 0F, 0F, 4, 1, 1);
|
||||
Shape4.setRotationPoint(-2F, 20F, 7F);
|
||||
Shape4.setTextureSize(64, 64);
|
||||
Shape4.mirror = true;
|
||||
setRotation(Shape4, 0F, 0F, 0F);
|
||||
Shape5 = new ModelRenderer(this, 38, 20);
|
||||
Shape5.addBox(0F, 0F, -3F, 4, 1, 3);
|
||||
Shape5.setRotationPoint(-2F, 20F, 7F);
|
||||
Shape5.setTextureSize(64, 64);
|
||||
Shape5.mirror = true;
|
||||
setRotation(Shape5, 0.3490659F, 0F, 0F);
|
||||
Shape6 = new ModelRenderer(this, 0, 25);
|
||||
Shape6.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
Shape6.setRotationPoint(-8F, 20F, -2F);
|
||||
Shape6.setTextureSize(64, 64);
|
||||
Shape6.mirror = true;
|
||||
setRotation(Shape6, 0F, 0F, 0F);
|
||||
Shape7 = new ModelRenderer(this, 11, 25);
|
||||
Shape7.addBox(0F, 0F, 0F, 3, 1, 4);
|
||||
Shape7.setRotationPoint(-7F, 20F, -2F);
|
||||
Shape7.setTextureSize(64, 64);
|
||||
Shape7.mirror = true;
|
||||
setRotation(Shape7, 0F, 0F, 0.3490659F);
|
||||
Shape8 = new ModelRenderer(this, 38, 25);
|
||||
Shape8.addBox(-3F, 0F, 0F, 3, 1, 4);
|
||||
Shape8.setRotationPoint(7F, 20F, -2F);
|
||||
Shape8.setTextureSize(64, 64);
|
||||
Shape8.mirror = true;
|
||||
setRotation(Shape8, 0F, 0F, -0.3490659F);
|
||||
Shape9 = new ModelRenderer(this, 27, 25);
|
||||
Shape9.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
Shape9.setRotationPoint(7F, 20F, -2F);
|
||||
Shape9.setTextureSize(64, 64);
|
||||
Shape9.mirror = true;
|
||||
setRotation(Shape9, 0F, 0F, 0F);
|
||||
Shape10 = new ModelRenderer(this, 0, 31);
|
||||
Shape10.addBox(0F, -7F, 0F, 2, 8, 2);
|
||||
Shape10.setRotationPoint(3F, 22F, 3F);
|
||||
Shape10.setTextureSize(64, 64);
|
||||
Shape10.mirror = true;
|
||||
setRotation(Shape10, 0.3490659F, 0F, -0.3490659F);
|
||||
Shape11 = new ModelRenderer(this, 10, 31);
|
||||
Shape11.addBox(-2F, -7F, -2F, 2, 8, 2);
|
||||
Shape11.setRotationPoint(-3F, 22F, -3F);
|
||||
Shape11.setTextureSize(64, 64);
|
||||
Shape11.mirror = true;
|
||||
setRotation(Shape11, -0.3490659F, 0F, 0.3490659F);
|
||||
Shape12 = new ModelRenderer(this, 20, 31);
|
||||
Shape12.addBox(0F, -7F, -2F, 2, 8, 2);
|
||||
Shape12.setRotationPoint(3F, 22F, -3F);
|
||||
Shape12.setTextureSize(64, 64);
|
||||
Shape12.mirror = true;
|
||||
setRotation(Shape12, -0.3490659F, 0F, -0.3490659F);
|
||||
Shape13 = new ModelRenderer(this, 30, 31);
|
||||
Shape13.addBox(-2F, -7F, 0F, 2, 8, 2);
|
||||
Shape13.setRotationPoint(-3F, 22F, 3F);
|
||||
Shape13.setTextureSize(64, 64);
|
||||
Shape13.mirror = true;
|
||||
setRotation(Shape13, 0.3490659F, 0F, 0.3490659F);
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(0F, 0F, 0F, 16, 3, 16);
|
||||
this.Shape1.setRotationPoint(-8F, 21F, -8F);
|
||||
this.Shape1.setTextureSize(64, 64);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0F, 0F, 0F);
|
||||
this.Shape2 = new ModelRenderer(this, 0, 20);
|
||||
this.Shape2.addBox(0F, 0F, 0F, 4, 1, 1);
|
||||
this.Shape2.setRotationPoint(-2F, 20F, -8F);
|
||||
this.Shape2.setTextureSize(64, 64);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0F, 0F, 0F);
|
||||
this.Shape3 = new ModelRenderer(this, 11, 20);
|
||||
this.Shape3.addBox(0F, 0F, 0F, 4, 1, 3);
|
||||
this.Shape3.setRotationPoint(-2F, 20F, -7F);
|
||||
this.Shape3.setTextureSize(64, 64);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, -0.3490659F, 0F, 0F);
|
||||
this.Shape4 = new ModelRenderer(this, 27, 20);
|
||||
this.Shape4.addBox(0F, 0F, 0F, 4, 1, 1);
|
||||
this.Shape4.setRotationPoint(-2F, 20F, 7F);
|
||||
this.Shape4.setTextureSize(64, 64);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0F, 0F, 0F);
|
||||
this.Shape5 = new ModelRenderer(this, 38, 20);
|
||||
this.Shape5.addBox(0F, 0F, -3F, 4, 1, 3);
|
||||
this.Shape5.setRotationPoint(-2F, 20F, 7F);
|
||||
this.Shape5.setTextureSize(64, 64);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.3490659F, 0F, 0F);
|
||||
this.Shape6 = new ModelRenderer(this, 0, 25);
|
||||
this.Shape6.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
this.Shape6.setRotationPoint(-8F, 20F, -2F);
|
||||
this.Shape6.setTextureSize(64, 64);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0F, 0F, 0F);
|
||||
this.Shape7 = new ModelRenderer(this, 11, 25);
|
||||
this.Shape7.addBox(0F, 0F, 0F, 3, 1, 4);
|
||||
this.Shape7.setRotationPoint(-7F, 20F, -2F);
|
||||
this.Shape7.setTextureSize(64, 64);
|
||||
this.Shape7.mirror = true;
|
||||
this.setRotation(this.Shape7, 0F, 0F, 0.3490659F);
|
||||
this.Shape8 = new ModelRenderer(this, 38, 25);
|
||||
this.Shape8.addBox(-3F, 0F, 0F, 3, 1, 4);
|
||||
this.Shape8.setRotationPoint(7F, 20F, -2F);
|
||||
this.Shape8.setTextureSize(64, 64);
|
||||
this.Shape8.mirror = true;
|
||||
this.setRotation(this.Shape8, 0F, 0F, -0.3490659F);
|
||||
this.Shape9 = new ModelRenderer(this, 27, 25);
|
||||
this.Shape9.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
this.Shape9.setRotationPoint(7F, 20F, -2F);
|
||||
this.Shape9.setTextureSize(64, 64);
|
||||
this.Shape9.mirror = true;
|
||||
this.setRotation(this.Shape9, 0F, 0F, 0F);
|
||||
this.Shape10 = new ModelRenderer(this, 0, 31);
|
||||
this.Shape10.addBox(0F, -7F, 0F, 2, 8, 2);
|
||||
this.Shape10.setRotationPoint(3F, 22F, 3F);
|
||||
this.Shape10.setTextureSize(64, 64);
|
||||
this.Shape10.mirror = true;
|
||||
this.setRotation(this.Shape10, 0.3490659F, 0F, -0.3490659F);
|
||||
this.Shape11 = new ModelRenderer(this, 10, 31);
|
||||
this.Shape11.addBox(-2F, -7F, -2F, 2, 8, 2);
|
||||
this.Shape11.setRotationPoint(-3F, 22F, -3F);
|
||||
this.Shape11.setTextureSize(64, 64);
|
||||
this.Shape11.mirror = true;
|
||||
this.setRotation(this.Shape11, -0.3490659F, 0F, 0.3490659F);
|
||||
this.Shape12 = new ModelRenderer(this, 20, 31);
|
||||
this.Shape12.addBox(0F, -7F, -2F, 2, 8, 2);
|
||||
this.Shape12.setRotationPoint(3F, 22F, -3F);
|
||||
this.Shape12.setTextureSize(64, 64);
|
||||
this.Shape12.mirror = true;
|
||||
this.setRotation(this.Shape12, -0.3490659F, 0F, -0.3490659F);
|
||||
this.Shape13 = new ModelRenderer(this, 30, 31);
|
||||
this.Shape13.addBox(-2F, -7F, 0F, 2, 8, 2);
|
||||
this.Shape13.setRotationPoint(-3F, 22F, 3F);
|
||||
this.Shape13.setTextureSize(64, 64);
|
||||
this.Shape13.mirror = true;
|
||||
this.setRotation(this.Shape13, 0.3490659F, 0F, 0.3490659F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
Shape4.render(f5);
|
||||
Shape5.render(f5);
|
||||
Shape6.render(f5);
|
||||
Shape7.render(f5);
|
||||
Shape8.render(f5);
|
||||
Shape9.render(f5);
|
||||
Shape10.render(f5);
|
||||
Shape11.render(f5);
|
||||
Shape12.render(f5);
|
||||
Shape13.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
this.Shape7.render(f5);
|
||||
this.Shape8.render(f5);
|
||||
this.Shape9.render(f5);
|
||||
this.Shape10.render(f5);
|
||||
this.Shape11.render(f5);
|
||||
this.Shape12.render(f5);
|
||||
this.Shape13.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -42,204 +42,204 @@ public class ModelEssentiaCompressor extends ModelBase {
|
||||
ModelRenderer InnerPillar4;
|
||||
|
||||
public ModelEssentiaCompressor() {
|
||||
textureWidth = 128;
|
||||
textureHeight = 32;
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 32;
|
||||
|
||||
Plate1 = new ModelRenderer(this, 64, 0);
|
||||
Plate1.addBox(0F, 0F, 0F, 16, 2, 16);
|
||||
Plate1.setRotationPoint(-8F, 22F, -8F);
|
||||
Plate1.setTextureSize(128, 32);
|
||||
Plate1.mirror = true;
|
||||
setRotation(Plate1, 0F, 0F, 0F);
|
||||
Plate2 = new ModelRenderer(this, 4, 0);
|
||||
Plate2.addBox(0F, 0F, 0F, 14, 2, 14);
|
||||
Plate2.setRotationPoint(-7F, 20F, -7F);
|
||||
Plate2.setTextureSize(128, 32);
|
||||
Plate2.mirror = true;
|
||||
setRotation(Plate2, 0F, 0F, 0F);
|
||||
Plate3 = new ModelRenderer(this, 4, 16);
|
||||
Plate3.addBox(0F, 0F, 0F, 12, 3, 12);
|
||||
Plate3.setRotationPoint(-6F, 17F, -6F);
|
||||
Plate3.setTextureSize(128, 32);
|
||||
Plate3.mirror = true;
|
||||
setRotation(Plate3, 0F, 0F, 0F);
|
||||
EdgePillar1 = new ModelRenderer(this, 0, 0);
|
||||
EdgePillar1.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
EdgePillar1.setRotationPoint(-8F, 0F, -8F);
|
||||
EdgePillar1.setTextureSize(128, 32);
|
||||
EdgePillar1.mirror = true;
|
||||
setRotation(EdgePillar1, 0F, 0F, 0F);
|
||||
EdgePillar2 = new ModelRenderer(this, 0, 0);
|
||||
EdgePillar2.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
EdgePillar2.setRotationPoint(7F, 0F, -8F);
|
||||
EdgePillar2.setTextureSize(128, 32);
|
||||
EdgePillar2.mirror = true;
|
||||
setRotation(EdgePillar2, 0F, 0F, 0F);
|
||||
EdgePillar3 = new ModelRenderer(this, 0, 0);
|
||||
EdgePillar3.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
EdgePillar3.setRotationPoint(7F, 0F, 7F);
|
||||
EdgePillar3.setTextureSize(128, 32);
|
||||
EdgePillar3.mirror = true;
|
||||
setRotation(EdgePillar3, 0F, 0F, 0F);
|
||||
EdgePillar4 = new ModelRenderer(this, 0, 0);
|
||||
EdgePillar4.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
EdgePillar4.setRotationPoint(-8F, 0F, 7F);
|
||||
EdgePillar4.setTextureSize(128, 32);
|
||||
EdgePillar4.mirror = true;
|
||||
setRotation(EdgePillar4, 0F, 0F, 0F);
|
||||
InnerLL1 = new ModelRenderer(this, 100, 18);
|
||||
InnerLL1.addBox(0F, 0F, 0F, 2, 3, 10);
|
||||
InnerLL1.setRotationPoint(-5F, 14F, -5F);
|
||||
InnerLL1.setTextureSize(128, 32);
|
||||
InnerLL1.mirror = true;
|
||||
setRotation(InnerLL1, 0F, 0F, 0F);
|
||||
InnerLL2 = new ModelRenderer(this, 100, 18);
|
||||
InnerLL2.addBox(0F, 0F, 0F, 2, 3, 10);
|
||||
InnerLL2.setRotationPoint(3F, 14F, -5F);
|
||||
InnerLL2.setTextureSize(128, 32);
|
||||
InnerLL2.mirror = true;
|
||||
setRotation(InnerLL2, 0F, 0F, 0F);
|
||||
InnerLSh1 = new ModelRenderer(this, 84, 18);
|
||||
InnerLSh1.addBox(0F, 0F, 0F, 6, 3, 2);
|
||||
InnerLSh1.setRotationPoint(-3F, 14F, -5F);
|
||||
InnerLSh1.setTextureSize(128, 32);
|
||||
InnerLSh1.mirror = true;
|
||||
setRotation(InnerLSh1, 0F, 0F, 0F);
|
||||
InnerLSH2 = new ModelRenderer(this, 84, 18);
|
||||
InnerLSH2.addBox(0F, 0F, 0F, 6, 3, 2);
|
||||
InnerLSH2.setRotationPoint(-3F, 14F, 3F);
|
||||
InnerLSH2.setTextureSize(128, 32);
|
||||
InnerLSH2.mirror = true;
|
||||
setRotation(InnerLSH2, 0F, 0F, 0F);
|
||||
InnerUp1 = new ModelRenderer(this, 64, 18);
|
||||
InnerUp1.addBox(0F, 0F, 0F, 1, 2, 6);
|
||||
InnerUp1.setRotationPoint(-5F, 12F, -3F);
|
||||
InnerUp1.setTextureSize(128, 32);
|
||||
InnerUp1.mirror = true;
|
||||
setRotation(InnerUp1, 0F, 0F, 0F);
|
||||
InnerUp2 = new ModelRenderer(this, 64, 18);
|
||||
InnerUp2.addBox(0F, 0F, 0F, 1, 2, 6);
|
||||
InnerUp2.setRotationPoint(4F, 12F, -3F);
|
||||
InnerUp2.setTextureSize(128, 32);
|
||||
InnerUp2.mirror = true;
|
||||
setRotation(InnerUp2, 0F, 0F, 0F);
|
||||
InnerUp3 = new ModelRenderer(this, 64, 18);
|
||||
InnerUp3.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
InnerUp3.setRotationPoint(-3F, 12F, 4F);
|
||||
InnerUp3.setTextureSize(128, 32);
|
||||
InnerUp3.mirror = true;
|
||||
setRotation(InnerUp3, 0F, 0F, 0F);
|
||||
InnerUp4 = new ModelRenderer(this, 64, 18);
|
||||
InnerUp4.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
InnerUp4.setRotationPoint(-3F, 12F, -5F);
|
||||
InnerUp4.setTextureSize(128, 32);
|
||||
InnerUp4.mirror = true;
|
||||
setRotation(InnerUp4, 0F, 0F, 0F);
|
||||
InnerEdgePiece1 = new ModelRenderer(this, 52, 18);
|
||||
InnerEdgePiece1.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
InnerEdgePiece1.setRotationPoint(3F, 9F, -5F);
|
||||
InnerEdgePiece1.setTextureSize(128, 32);
|
||||
InnerEdgePiece1.mirror = true;
|
||||
setRotation(InnerEdgePiece1, 0F, 0F, 0F);
|
||||
InnerEdgePiece2 = new ModelRenderer(this, 52, 18);
|
||||
InnerEdgePiece2.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
InnerEdgePiece2.setRotationPoint(3F, 9F, 3F);
|
||||
InnerEdgePiece2.setTextureSize(128, 32);
|
||||
InnerEdgePiece2.mirror = true;
|
||||
setRotation(InnerEdgePiece2, 0F, 0F, 0F);
|
||||
InnerEdgePiece3 = new ModelRenderer(this, 52, 18);
|
||||
InnerEdgePiece3.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
InnerEdgePiece3.setRotationPoint(-5F, 9F, 3F);
|
||||
InnerEdgePiece3.setTextureSize(128, 32);
|
||||
InnerEdgePiece3.mirror = true;
|
||||
setRotation(InnerEdgePiece3, 0F, 0F, 0F);
|
||||
InnerEdgePiece4 = new ModelRenderer(this, 52, 18);
|
||||
InnerEdgePiece4.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
InnerEdgePiece4.setRotationPoint(-5F, 9F, -5F);
|
||||
InnerEdgePiece4.setTextureSize(128, 32);
|
||||
InnerEdgePiece4.mirror = true;
|
||||
setRotation(InnerEdgePiece4, 0F, 0F, 0F);
|
||||
InnerPeak1 = new ModelRenderer(this, 124, 18);
|
||||
InnerPeak1.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
InnerPeak1.setRotationPoint(-5F, 4F, -5F);
|
||||
InnerPeak1.setTextureSize(128, 32);
|
||||
InnerPeak1.mirror = true;
|
||||
setRotation(InnerPeak1, 0F, 0F, 0F);
|
||||
InnerPeak2 = new ModelRenderer(this, 124, 18);
|
||||
InnerPeak2.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
InnerPeak2.setRotationPoint(-5F, 4F, 4F);
|
||||
InnerPeak2.setTextureSize(128, 32);
|
||||
InnerPeak2.mirror = true;
|
||||
setRotation(InnerPeak2, 0F, 0F, 0F);
|
||||
InnerPeak3 = new ModelRenderer(this, 124, 18);
|
||||
InnerPeak3.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
InnerPeak3.setRotationPoint(4F, 4F, -5F);
|
||||
InnerPeak3.setTextureSize(128, 32);
|
||||
InnerPeak3.mirror = true;
|
||||
setRotation(InnerPeak3, 0F, 0F, 0F);
|
||||
InnerPeak4 = new ModelRenderer(this, 124, 18);
|
||||
InnerPeak4.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
InnerPeak4.setRotationPoint(4F, 4F, 4F);
|
||||
InnerPeak4.setTextureSize(128, 32);
|
||||
InnerPeak4.mirror = true;
|
||||
setRotation(InnerPeak4, 0F, 0F, 0F);
|
||||
InnerPillar1 = new ModelRenderer(this, 0, 0);
|
||||
InnerPillar1.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
InnerPillar1.setRotationPoint(5F, 0F, 5F);
|
||||
InnerPillar1.setTextureSize(128, 32);
|
||||
InnerPillar1.mirror = true;
|
||||
setRotation(InnerPillar1, 0F, 0F, 0F);
|
||||
InnerPillar2 = new ModelRenderer(this, 0, 0);
|
||||
InnerPillar2.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
InnerPillar2.setRotationPoint(5F, 0F, -6F);
|
||||
InnerPillar2.setTextureSize(128, 32);
|
||||
InnerPillar2.mirror = true;
|
||||
setRotation(InnerPillar2, 0F, 0F, 0F);
|
||||
InnerPillar3 = new ModelRenderer(this, 0, 0);
|
||||
InnerPillar3.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
InnerPillar3.setRotationPoint(-6F, 0F, -6F);
|
||||
InnerPillar3.setTextureSize(128, 32);
|
||||
InnerPillar3.mirror = true;
|
||||
setRotation(InnerPillar3, 0F, 0F, 0F);
|
||||
InnerPillar4 = new ModelRenderer(this, 0, 0);
|
||||
InnerPillar4.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
InnerPillar4.setRotationPoint(-6F, 0F, 5F);
|
||||
InnerPillar4.setTextureSize(128, 32);
|
||||
InnerPillar4.mirror = true;
|
||||
setRotation(InnerPillar4, 0F, 0F, 0F);
|
||||
this.Plate1 = new ModelRenderer(this, 64, 0);
|
||||
this.Plate1.addBox(0F, 0F, 0F, 16, 2, 16);
|
||||
this.Plate1.setRotationPoint(-8F, 22F, -8F);
|
||||
this.Plate1.setTextureSize(128, 32);
|
||||
this.Plate1.mirror = true;
|
||||
this.setRotation(this.Plate1, 0F, 0F, 0F);
|
||||
this.Plate2 = new ModelRenderer(this, 4, 0);
|
||||
this.Plate2.addBox(0F, 0F, 0F, 14, 2, 14);
|
||||
this.Plate2.setRotationPoint(-7F, 20F, -7F);
|
||||
this.Plate2.setTextureSize(128, 32);
|
||||
this.Plate2.mirror = true;
|
||||
this.setRotation(this.Plate2, 0F, 0F, 0F);
|
||||
this.Plate3 = new ModelRenderer(this, 4, 16);
|
||||
this.Plate3.addBox(0F, 0F, 0F, 12, 3, 12);
|
||||
this.Plate3.setRotationPoint(-6F, 17F, -6F);
|
||||
this.Plate3.setTextureSize(128, 32);
|
||||
this.Plate3.mirror = true;
|
||||
this.setRotation(this.Plate3, 0F, 0F, 0F);
|
||||
this.EdgePillar1 = new ModelRenderer(this, 0, 0);
|
||||
this.EdgePillar1.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
this.EdgePillar1.setRotationPoint(-8F, 0F, -8F);
|
||||
this.EdgePillar1.setTextureSize(128, 32);
|
||||
this.EdgePillar1.mirror = true;
|
||||
this.setRotation(this.EdgePillar1, 0F, 0F, 0F);
|
||||
this.EdgePillar2 = new ModelRenderer(this, 0, 0);
|
||||
this.EdgePillar2.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
this.EdgePillar2.setRotationPoint(7F, 0F, -8F);
|
||||
this.EdgePillar2.setTextureSize(128, 32);
|
||||
this.EdgePillar2.mirror = true;
|
||||
this.setRotation(this.EdgePillar2, 0F, 0F, 0F);
|
||||
this.EdgePillar3 = new ModelRenderer(this, 0, 0);
|
||||
this.EdgePillar3.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
this.EdgePillar3.setRotationPoint(7F, 0F, 7F);
|
||||
this.EdgePillar3.setTextureSize(128, 32);
|
||||
this.EdgePillar3.mirror = true;
|
||||
this.setRotation(this.EdgePillar3, 0F, 0F, 0F);
|
||||
this.EdgePillar4 = new ModelRenderer(this, 0, 0);
|
||||
this.EdgePillar4.addBox(0F, 0F, 0F, 1, 22, 1);
|
||||
this.EdgePillar4.setRotationPoint(-8F, 0F, 7F);
|
||||
this.EdgePillar4.setTextureSize(128, 32);
|
||||
this.EdgePillar4.mirror = true;
|
||||
this.setRotation(this.EdgePillar4, 0F, 0F, 0F);
|
||||
this.InnerLL1 = new ModelRenderer(this, 100, 18);
|
||||
this.InnerLL1.addBox(0F, 0F, 0F, 2, 3, 10);
|
||||
this.InnerLL1.setRotationPoint(-5F, 14F, -5F);
|
||||
this.InnerLL1.setTextureSize(128, 32);
|
||||
this.InnerLL1.mirror = true;
|
||||
this.setRotation(this.InnerLL1, 0F, 0F, 0F);
|
||||
this.InnerLL2 = new ModelRenderer(this, 100, 18);
|
||||
this.InnerLL2.addBox(0F, 0F, 0F, 2, 3, 10);
|
||||
this.InnerLL2.setRotationPoint(3F, 14F, -5F);
|
||||
this.InnerLL2.setTextureSize(128, 32);
|
||||
this.InnerLL2.mirror = true;
|
||||
this.setRotation(this.InnerLL2, 0F, 0F, 0F);
|
||||
this.InnerLSh1 = new ModelRenderer(this, 84, 18);
|
||||
this.InnerLSh1.addBox(0F, 0F, 0F, 6, 3, 2);
|
||||
this.InnerLSh1.setRotationPoint(-3F, 14F, -5F);
|
||||
this.InnerLSh1.setTextureSize(128, 32);
|
||||
this.InnerLSh1.mirror = true;
|
||||
this.setRotation(this.InnerLSh1, 0F, 0F, 0F);
|
||||
this.InnerLSH2 = new ModelRenderer(this, 84, 18);
|
||||
this.InnerLSH2.addBox(0F, 0F, 0F, 6, 3, 2);
|
||||
this.InnerLSH2.setRotationPoint(-3F, 14F, 3F);
|
||||
this.InnerLSH2.setTextureSize(128, 32);
|
||||
this.InnerLSH2.mirror = true;
|
||||
this.setRotation(this.InnerLSH2, 0F, 0F, 0F);
|
||||
this.InnerUp1 = new ModelRenderer(this, 64, 18);
|
||||
this.InnerUp1.addBox(0F, 0F, 0F, 1, 2, 6);
|
||||
this.InnerUp1.setRotationPoint(-5F, 12F, -3F);
|
||||
this.InnerUp1.setTextureSize(128, 32);
|
||||
this.InnerUp1.mirror = true;
|
||||
this.setRotation(this.InnerUp1, 0F, 0F, 0F);
|
||||
this.InnerUp2 = new ModelRenderer(this, 64, 18);
|
||||
this.InnerUp2.addBox(0F, 0F, 0F, 1, 2, 6);
|
||||
this.InnerUp2.setRotationPoint(4F, 12F, -3F);
|
||||
this.InnerUp2.setTextureSize(128, 32);
|
||||
this.InnerUp2.mirror = true;
|
||||
this.setRotation(this.InnerUp2, 0F, 0F, 0F);
|
||||
this.InnerUp3 = new ModelRenderer(this, 64, 18);
|
||||
this.InnerUp3.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
this.InnerUp3.setRotationPoint(-3F, 12F, 4F);
|
||||
this.InnerUp3.setTextureSize(128, 32);
|
||||
this.InnerUp3.mirror = true;
|
||||
this.setRotation(this.InnerUp3, 0F, 0F, 0F);
|
||||
this.InnerUp4 = new ModelRenderer(this, 64, 18);
|
||||
this.InnerUp4.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
this.InnerUp4.setRotationPoint(-3F, 12F, -5F);
|
||||
this.InnerUp4.setTextureSize(128, 32);
|
||||
this.InnerUp4.mirror = true;
|
||||
this.setRotation(this.InnerUp4, 0F, 0F, 0F);
|
||||
this.InnerEdgePiece1 = new ModelRenderer(this, 52, 18);
|
||||
this.InnerEdgePiece1.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
this.InnerEdgePiece1.setRotationPoint(3F, 9F, -5F);
|
||||
this.InnerEdgePiece1.setTextureSize(128, 32);
|
||||
this.InnerEdgePiece1.mirror = true;
|
||||
this.setRotation(this.InnerEdgePiece1, 0F, 0F, 0F);
|
||||
this.InnerEdgePiece2 = new ModelRenderer(this, 52, 18);
|
||||
this.InnerEdgePiece2.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
this.InnerEdgePiece2.setRotationPoint(3F, 9F, 3F);
|
||||
this.InnerEdgePiece2.setTextureSize(128, 32);
|
||||
this.InnerEdgePiece2.mirror = true;
|
||||
this.setRotation(this.InnerEdgePiece2, 0F, 0F, 0F);
|
||||
this.InnerEdgePiece3 = new ModelRenderer(this, 52, 18);
|
||||
this.InnerEdgePiece3.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
this.InnerEdgePiece3.setRotationPoint(-5F, 9F, 3F);
|
||||
this.InnerEdgePiece3.setTextureSize(128, 32);
|
||||
this.InnerEdgePiece3.mirror = true;
|
||||
this.setRotation(this.InnerEdgePiece3, 0F, 0F, 0F);
|
||||
this.InnerEdgePiece4 = new ModelRenderer(this, 52, 18);
|
||||
this.InnerEdgePiece4.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
this.InnerEdgePiece4.setRotationPoint(-5F, 9F, -5F);
|
||||
this.InnerEdgePiece4.setTextureSize(128, 32);
|
||||
this.InnerEdgePiece4.mirror = true;
|
||||
this.setRotation(this.InnerEdgePiece4, 0F, 0F, 0F);
|
||||
this.InnerPeak1 = new ModelRenderer(this, 124, 18);
|
||||
this.InnerPeak1.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
this.InnerPeak1.setRotationPoint(-5F, 4F, -5F);
|
||||
this.InnerPeak1.setTextureSize(128, 32);
|
||||
this.InnerPeak1.mirror = true;
|
||||
this.setRotation(this.InnerPeak1, 0F, 0F, 0F);
|
||||
this.InnerPeak2 = new ModelRenderer(this, 124, 18);
|
||||
this.InnerPeak2.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
this.InnerPeak2.setRotationPoint(-5F, 4F, 4F);
|
||||
this.InnerPeak2.setTextureSize(128, 32);
|
||||
this.InnerPeak2.mirror = true;
|
||||
this.setRotation(this.InnerPeak2, 0F, 0F, 0F);
|
||||
this.InnerPeak3 = new ModelRenderer(this, 124, 18);
|
||||
this.InnerPeak3.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
this.InnerPeak3.setRotationPoint(4F, 4F, -5F);
|
||||
this.InnerPeak3.setTextureSize(128, 32);
|
||||
this.InnerPeak3.mirror = true;
|
||||
this.setRotation(this.InnerPeak3, 0F, 0F, 0F);
|
||||
this.InnerPeak4 = new ModelRenderer(this, 124, 18);
|
||||
this.InnerPeak4.addBox(0F, 0F, 0F, 1, 5, 1);
|
||||
this.InnerPeak4.setRotationPoint(4F, 4F, 4F);
|
||||
this.InnerPeak4.setTextureSize(128, 32);
|
||||
this.InnerPeak4.mirror = true;
|
||||
this.setRotation(this.InnerPeak4, 0F, 0F, 0F);
|
||||
this.InnerPillar1 = new ModelRenderer(this, 0, 0);
|
||||
this.InnerPillar1.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
this.InnerPillar1.setRotationPoint(5F, 0F, 5F);
|
||||
this.InnerPillar1.setTextureSize(128, 32);
|
||||
this.InnerPillar1.mirror = true;
|
||||
this.setRotation(this.InnerPillar1, 0F, 0F, 0F);
|
||||
this.InnerPillar2 = new ModelRenderer(this, 0, 0);
|
||||
this.InnerPillar2.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
this.InnerPillar2.setRotationPoint(5F, 0F, -6F);
|
||||
this.InnerPillar2.setTextureSize(128, 32);
|
||||
this.InnerPillar2.mirror = true;
|
||||
this.setRotation(this.InnerPillar2, 0F, 0F, 0F);
|
||||
this.InnerPillar3 = new ModelRenderer(this, 0, 0);
|
||||
this.InnerPillar3.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
this.InnerPillar3.setRotationPoint(-6F, 0F, -6F);
|
||||
this.InnerPillar3.setTextureSize(128, 32);
|
||||
this.InnerPillar3.mirror = true;
|
||||
this.setRotation(this.InnerPillar3, 0F, 0F, 0F);
|
||||
this.InnerPillar4 = new ModelRenderer(this, 0, 0);
|
||||
this.InnerPillar4.addBox(0F, 0F, 0F, 1, 17, 1);
|
||||
this.InnerPillar4.setRotationPoint(-6F, 0F, 5F);
|
||||
this.InnerPillar4.setTextureSize(128, 32);
|
||||
this.InnerPillar4.mirror = true;
|
||||
this.setRotation(this.InnerPillar4, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Plate1.render(f5);
|
||||
Plate2.render(f5);
|
||||
Plate3.render(f5);
|
||||
EdgePillar1.render(f5);
|
||||
EdgePillar2.render(f5);
|
||||
EdgePillar3.render(f5);
|
||||
EdgePillar4.render(f5);
|
||||
InnerLL1.render(f5);
|
||||
InnerLL2.render(f5);
|
||||
InnerLSh1.render(f5);
|
||||
InnerLSH2.render(f5);
|
||||
InnerUp1.render(f5);
|
||||
InnerUp2.render(f5);
|
||||
InnerUp3.render(f5);
|
||||
InnerUp4.render(f5);
|
||||
InnerEdgePiece1.render(f5);
|
||||
InnerEdgePiece2.render(f5);
|
||||
InnerEdgePiece3.render(f5);
|
||||
InnerEdgePiece4.render(f5);
|
||||
InnerPeak1.render(f5);
|
||||
InnerPeak2.render(f5);
|
||||
InnerPeak3.render(f5);
|
||||
InnerPeak4.render(f5);
|
||||
InnerPillar1.render(f5);
|
||||
InnerPillar2.render(f5);
|
||||
InnerPillar3.render(f5);
|
||||
InnerPillar4.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.Plate1.render(f5);
|
||||
this.Plate2.render(f5);
|
||||
this.Plate3.render(f5);
|
||||
this.EdgePillar1.render(f5);
|
||||
this.EdgePillar2.render(f5);
|
||||
this.EdgePillar3.render(f5);
|
||||
this.EdgePillar4.render(f5);
|
||||
this.InnerLL1.render(f5);
|
||||
this.InnerLL2.render(f5);
|
||||
this.InnerLSh1.render(f5);
|
||||
this.InnerLSH2.render(f5);
|
||||
this.InnerUp1.render(f5);
|
||||
this.InnerUp2.render(f5);
|
||||
this.InnerUp3.render(f5);
|
||||
this.InnerUp4.render(f5);
|
||||
this.InnerEdgePiece1.render(f5);
|
||||
this.InnerEdgePiece2.render(f5);
|
||||
this.InnerEdgePiece3.render(f5);
|
||||
this.InnerEdgePiece4.render(f5);
|
||||
this.InnerPeak1.render(f5);
|
||||
this.InnerPeak2.render(f5);
|
||||
this.InnerPeak3.render(f5);
|
||||
this.InnerPeak4.render(f5);
|
||||
this.InnerPillar1.render(f5);
|
||||
this.InnerPillar2.render(f5);
|
||||
this.InnerPillar3.render(f5);
|
||||
this.InnerPillar4.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -21,48 +21,48 @@ public class ModelFocusPortalPart extends ModelBase {
|
||||
ModelRenderer shape5;
|
||||
|
||||
public ModelFocusPortalPart() {
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 32;
|
||||
|
||||
shape1 = new ModelRenderer(this, 0, 3);
|
||||
shape1.addBox(-1F, -2F, 0.41F, 2, 5, 1);
|
||||
shape1.setRotationPoint(0F, 20F, 3.533333F);
|
||||
shape1.setTextureSize(64, 32);
|
||||
shape1.mirror = true;
|
||||
setRotation(shape1, 0F, 0F, 0F);
|
||||
shape2 = new ModelRenderer(this, 0, 0);
|
||||
shape2.addBox(-1F, -1F, 0F, 2, 2, 1);
|
||||
shape2.setRotationPoint(0F, 23F, 3.5F);
|
||||
shape2.setTextureSize(64, 32);
|
||||
shape2.mirror = true;
|
||||
setRotation(shape2, -0.7853982F, 0F, 0F);
|
||||
shape3 = new ModelRenderer(this, 0, 12);
|
||||
shape3.addBox(0F, 0F, 0F, 2, 2, 1);
|
||||
shape3.setRotationPoint(-1F, 21F, 2.5F);
|
||||
shape3.setTextureSize(64, 32);
|
||||
shape3.mirror = true;
|
||||
setRotation(shape3, 0.7853982F, 0F, 0F);
|
||||
shape4 = new ModelRenderer(this, 0, 9);
|
||||
shape4.addBox(0F, 0F, 0F, 2, 2, 1);
|
||||
shape4.setRotationPoint(-1F, 19F, 2.5F);
|
||||
shape4.setTextureSize(64, 32);
|
||||
shape4.mirror = true;
|
||||
setRotation(shape4, 0.7853982F, 0F, 0F);
|
||||
shape5 = new ModelRenderer(this, 6, 0);
|
||||
shape5.addBox(0F, -1F, 0.03F, 2, 4, 1);
|
||||
shape5.setRotationPoint(-1F, 18F, 3.5F);
|
||||
shape5.setTextureSize(64, 32);
|
||||
shape5.mirror = true;
|
||||
setRotation(shape5, 0.7853982F, 0F, 0F);
|
||||
this.shape1 = new ModelRenderer(this, 0, 3);
|
||||
this.shape1.addBox(-1F, -2F, 0.41F, 2, 5, 1);
|
||||
this.shape1.setRotationPoint(0F, 20F, 3.533333F);
|
||||
this.shape1.setTextureSize(64, 32);
|
||||
this.shape1.mirror = true;
|
||||
this.setRotation(this.shape1, 0F, 0F, 0F);
|
||||
this.shape2 = new ModelRenderer(this, 0, 0);
|
||||
this.shape2.addBox(-1F, -1F, 0F, 2, 2, 1);
|
||||
this.shape2.setRotationPoint(0F, 23F, 3.5F);
|
||||
this.shape2.setTextureSize(64, 32);
|
||||
this.shape2.mirror = true;
|
||||
this.setRotation(this.shape2, -0.7853982F, 0F, 0F);
|
||||
this.shape3 = new ModelRenderer(this, 0, 12);
|
||||
this.shape3.addBox(0F, 0F, 0F, 2, 2, 1);
|
||||
this.shape3.setRotationPoint(-1F, 21F, 2.5F);
|
||||
this.shape3.setTextureSize(64, 32);
|
||||
this.shape3.mirror = true;
|
||||
this.setRotation(this.shape3, 0.7853982F, 0F, 0F);
|
||||
this.shape4 = new ModelRenderer(this, 0, 9);
|
||||
this.shape4.addBox(0F, 0F, 0F, 2, 2, 1);
|
||||
this.shape4.setRotationPoint(-1F, 19F, 2.5F);
|
||||
this.shape4.setTextureSize(64, 32);
|
||||
this.shape4.mirror = true;
|
||||
this.setRotation(this.shape4, 0.7853982F, 0F, 0F);
|
||||
this.shape5 = new ModelRenderer(this, 6, 0);
|
||||
this.shape5.addBox(0F, -1F, 0.03F, 2, 4, 1);
|
||||
this.shape5.setRotationPoint(-1F, 18F, 3.5F);
|
||||
this.shape5.setTextureSize(64, 32);
|
||||
this.shape5.mirror = true;
|
||||
this.setRotation(this.shape5, 0.7853982F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
shape1.render(f5);
|
||||
shape2.render(f5);
|
||||
shape3.render(f5);
|
||||
shape4.render(f5);
|
||||
shape5.render(f5);
|
||||
this.shape1.render(f5);
|
||||
this.shape2.render(f5);
|
||||
this.shape3.render(f5);
|
||||
this.shape4.render(f5);
|
||||
this.shape5.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -17,21 +17,21 @@ public class ModelInfusionClawPart extends ModelBase {
|
||||
ModelRenderer shape1;
|
||||
|
||||
public ModelInfusionClawPart(int num) {
|
||||
textureWidth = 32;
|
||||
textureHeight = 64;
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
|
||||
shape1 = new ModelRenderer(this, 0, 8*num);
|
||||
shape1.addBox(-3F, -1F, -3F, 6, 2, 6);
|
||||
shape1.setRotationPoint(0F, 0F, 0F);
|
||||
shape1.setTextureSize(32, 64);
|
||||
shape1.mirror = true;
|
||||
setRotation(shape1, 0F, 0F, 0F);
|
||||
this.shape1 = new ModelRenderer(this, 0, 8*num);
|
||||
this.shape1.addBox(-3F, -1F, -3F, 6, 2, 6);
|
||||
this.shape1.setRotationPoint(0F, 0F, 0F);
|
||||
this.shape1.setTextureSize(32, 64);
|
||||
this.shape1.mirror = true;
|
||||
this.setRotation(this.shape1, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape1.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.shape1.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -21,49 +21,49 @@ public class ModelJarPot extends ModelBase {
|
||||
ModelRenderer shape5;
|
||||
|
||||
public ModelJarPot() {
|
||||
textureWidth = 32;
|
||||
textureHeight = 64;
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 64;
|
||||
|
||||
shape1 = new ModelRenderer(this, 0, 0);
|
||||
shape1.addBox(0F, 0F, 0F, 10, 0, 10);
|
||||
shape1.setRotationPoint(-5F, 24F, -5F);
|
||||
shape1.setTextureSize(32, 64);
|
||||
shape1.mirror = true;
|
||||
setRotation(shape1, 0F, 0F, 0F);
|
||||
shape2 = new ModelRenderer(this, 0, 28);
|
||||
shape2.addBox(0F, 0F, 0F, 1, 6, 12);
|
||||
shape2.setRotationPoint(-6F, 18F, -6F);
|
||||
shape2.setTextureSize(32, 64);
|
||||
shape2.mirror = true;
|
||||
setRotation(shape2, 0F, 0F, 0F);
|
||||
shape3 = new ModelRenderer(this, 0, 10);
|
||||
shape3.addBox(0F, 0F, 0F, 1, 6, 12);
|
||||
shape3.setRotationPoint(5F, 18F, -6F);
|
||||
shape3.setTextureSize(32, 64);
|
||||
shape3.mirror = true;
|
||||
setRotation(shape3, 0F, 0F, 0F);
|
||||
shape4 = new ModelRenderer(this, 0, 53);
|
||||
shape4.addBox(0F, 0F, 0F, 10, 6, 1);
|
||||
shape4.setRotationPoint(-5F, 18F, 5F);
|
||||
shape4.setTextureSize(32, 64);
|
||||
shape4.mirror = true;
|
||||
setRotation(shape4, 0F, 0F, 0F);
|
||||
shape5 = new ModelRenderer(this, 0, 46);
|
||||
shape5.addBox(0F, 0F, 0F, 10, 6, 1);
|
||||
shape5.setRotationPoint(-5F, 18F, -6F);
|
||||
shape5.setTextureSize(32, 64);
|
||||
shape5.mirror = true;
|
||||
setRotation(shape5, 0F, 0F, 0F);
|
||||
this.shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.shape1.addBox(0F, 0F, 0F, 10, 0, 10);
|
||||
this.shape1.setRotationPoint(-5F, 24F, -5F);
|
||||
this.shape1.setTextureSize(32, 64);
|
||||
this.shape1.mirror = true;
|
||||
this.setRotation(this.shape1, 0F, 0F, 0F);
|
||||
this.shape2 = new ModelRenderer(this, 0, 28);
|
||||
this.shape2.addBox(0F, 0F, 0F, 1, 6, 12);
|
||||
this.shape2.setRotationPoint(-6F, 18F, -6F);
|
||||
this.shape2.setTextureSize(32, 64);
|
||||
this.shape2.mirror = true;
|
||||
this.setRotation(this.shape2, 0F, 0F, 0F);
|
||||
this.shape3 = new ModelRenderer(this, 0, 10);
|
||||
this.shape3.addBox(0F, 0F, 0F, 1, 6, 12);
|
||||
this.shape3.setRotationPoint(5F, 18F, -6F);
|
||||
this.shape3.setTextureSize(32, 64);
|
||||
this.shape3.mirror = true;
|
||||
this.setRotation(this.shape3, 0F, 0F, 0F);
|
||||
this.shape4 = new ModelRenderer(this, 0, 53);
|
||||
this.shape4.addBox(0F, 0F, 0F, 10, 6, 1);
|
||||
this.shape4.setRotationPoint(-5F, 18F, 5F);
|
||||
this.shape4.setTextureSize(32, 64);
|
||||
this.shape4.mirror = true;
|
||||
this.setRotation(this.shape4, 0F, 0F, 0F);
|
||||
this.shape5 = new ModelRenderer(this, 0, 46);
|
||||
this.shape5.addBox(0F, 0F, 0F, 10, 6, 1);
|
||||
this.shape5.setRotationPoint(-5F, 18F, -6F);
|
||||
this.shape5.setTextureSize(32, 64);
|
||||
this.shape5.mirror = true;
|
||||
this.setRotation(this.shape5, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape1.render(f5);
|
||||
shape2.render(f5);
|
||||
shape3.render(f5);
|
||||
shape4.render(f5);
|
||||
shape5.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.shape1.render(f5);
|
||||
this.shape2.render(f5);
|
||||
this.shape3.render(f5);
|
||||
this.shape4.render(f5);
|
||||
this.shape5.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -20,42 +20,42 @@ public class ModelManipulatorPart extends ModelBase {
|
||||
ModelRenderer shape5;
|
||||
|
||||
public ModelManipulatorPart() {
|
||||
textureWidth = 8;
|
||||
textureHeight = 16;
|
||||
this.textureWidth = 8;
|
||||
this.textureHeight = 16;
|
||||
|
||||
shape2 = new ModelRenderer(this, 0, 5);
|
||||
shape2.addBox(-1F, -2F, 0.41F, 2, 2, 1);
|
||||
shape2.setRotationPoint(0F, 22F, 4F);
|
||||
shape2.setTextureSize(8, 16);
|
||||
shape2.mirror = true;
|
||||
setRotation(shape2, 0F, 0F, 0F);
|
||||
shape3 = new ModelRenderer(this, 0, 8);
|
||||
shape3.addBox(-1F, -3.4F, 1F, 2, 2, 1);
|
||||
shape3.setRotationPoint(0F, 22F, 4F);
|
||||
shape3.setTextureSize(8, 16);
|
||||
shape3.mirror = true;
|
||||
setRotation(shape3, 0.3490659F, 0F, 0F);
|
||||
shape4 = new ModelRenderer(this, 0, 0);
|
||||
shape4.addBox(-1F, -1F, 0F, 2, 4, 1);
|
||||
shape4.setRotationPoint(0F, 22F, 4F);
|
||||
shape4.setTextureSize(8, 16);
|
||||
shape4.mirror = true;
|
||||
setRotation(shape4, -0.7853982F, 0F, 0F);
|
||||
shape5 = new ModelRenderer(this, 0, 11);
|
||||
shape5.addBox(-1F, -4.25F, 2.24F, 2, 2, 1);
|
||||
shape5.setRotationPoint(0F, 22F, 4F);
|
||||
shape5.setTextureSize(8, 16);
|
||||
shape5.mirror = true;
|
||||
setRotation(shape5, 0.7853982F, 0F, 0F);
|
||||
this.shape2 = new ModelRenderer(this, 0, 5);
|
||||
this.shape2.addBox(-1F, -2F, 0.41F, 2, 2, 1);
|
||||
this.shape2.setRotationPoint(0F, 22F, 4F);
|
||||
this.shape2.setTextureSize(8, 16);
|
||||
this.shape2.mirror = true;
|
||||
this.setRotation(this.shape2, 0F, 0F, 0F);
|
||||
this.shape3 = new ModelRenderer(this, 0, 8);
|
||||
this.shape3.addBox(-1F, -3.4F, 1F, 2, 2, 1);
|
||||
this.shape3.setRotationPoint(0F, 22F, 4F);
|
||||
this.shape3.setTextureSize(8, 16);
|
||||
this.shape3.mirror = true;
|
||||
this.setRotation(this.shape3, 0.3490659F, 0F, 0F);
|
||||
this.shape4 = new ModelRenderer(this, 0, 0);
|
||||
this.shape4.addBox(-1F, -1F, 0F, 2, 4, 1);
|
||||
this.shape4.setRotationPoint(0F, 22F, 4F);
|
||||
this.shape4.setTextureSize(8, 16);
|
||||
this.shape4.mirror = true;
|
||||
this.setRotation(this.shape4, -0.7853982F, 0F, 0F);
|
||||
this.shape5 = new ModelRenderer(this, 0, 11);
|
||||
this.shape5.addBox(-1F, -4.25F, 2.24F, 2, 2, 1);
|
||||
this.shape5.setRotationPoint(0F, 22F, 4F);
|
||||
this.shape5.setTextureSize(8, 16);
|
||||
this.shape5.mirror = true;
|
||||
this.setRotation(this.shape5, 0.7853982F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape2.render(f5);
|
||||
shape3.render(f5);
|
||||
shape4.render(f5);
|
||||
shape5.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.shape2.render(f5);
|
||||
this.shape3.render(f5);
|
||||
this.shape4.render(f5);
|
||||
this.shape5.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -18,26 +18,26 @@ public class ModelPackagerPiston extends ModelBase {
|
||||
|
||||
public ModelPackagerPiston(boolean cut)
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
|
||||
shape1 = new ModelRenderer(this, 0, 0);
|
||||
shape1.addBox(0F, 0F, 0F, 10, 2, 10);
|
||||
shape1.setRotationPoint(-5F, 16F, -5F);
|
||||
shape1.setTextureSize(64, 32);
|
||||
shape1.mirror = true;
|
||||
this.shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.shape1.addBox(0F, 0F, 0F, 10, 2, 10);
|
||||
this.shape1.setRotationPoint(-5F, 16F, -5F);
|
||||
this.shape1.setTextureSize(64, 32);
|
||||
this.shape1.mirror = true;
|
||||
|
||||
shape2 = new ModelRenderer(this, 41, cut ? 1 : 0);
|
||||
shape2.addBox(0F, 0F, 0F, 4, 4, 4);
|
||||
shape2.setRotationPoint(-2F, cut ? 13F : 12F, -2F);
|
||||
shape2.setTextureSize(64, 32);
|
||||
shape2.mirror = true;
|
||||
this.shape2 = new ModelRenderer(this, 41, cut ? 1 : 0);
|
||||
this.shape2.addBox(0F, 0F, 0F, 4, 4, 4);
|
||||
this.shape2.setRotationPoint(-2F, cut ? 13F : 12F, -2F);
|
||||
this.shape2.setTextureSize(64, 32);
|
||||
this.shape2.mirror = true;
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
shape1.render(f5);
|
||||
shape2.render(f5);
|
||||
this.shape1.render(f5);
|
||||
this.shape2.render(f5);
|
||||
}
|
||||
}
|
||||
@@ -15,21 +15,21 @@ public class ModelPackedCompressorBlock extends ModelBase {
|
||||
ModelRenderer block;
|
||||
|
||||
public ModelPackedCompressorBlock() {
|
||||
textureHeight = 16;
|
||||
textureWidth = 16;
|
||||
this.textureHeight = 16;
|
||||
this.textureWidth = 16;
|
||||
|
||||
block = new ModelRenderer(this, 0, 0);
|
||||
block.addBox(0F, 0F, 0F, 16, 16, 16);
|
||||
block.setRotationPoint(-8F, 22F, -8F);
|
||||
this.block = new ModelRenderer(this, 0, 0);
|
||||
this.block.addBox(0F, 0F, 0F, 16, 16, 16);
|
||||
this.block.setRotationPoint(-8F, 22F, -8F);
|
||||
//block.setTextureSize(16, 16);
|
||||
block.mirror = true;
|
||||
this.block.mirror = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
block.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.block.render(f5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,21 +17,21 @@ public class ModelSmallCube extends ModelBase {
|
||||
ModelRenderer shape1;
|
||||
|
||||
public ModelSmallCube() {
|
||||
textureWidth = 8;
|
||||
textureHeight = 4;
|
||||
this.textureWidth = 8;
|
||||
this.textureHeight = 4;
|
||||
|
||||
shape1 = new ModelRenderer(this, 0, 0);
|
||||
shape1.addBox(-1F, -3F, -1F, 2, 2, 2);
|
||||
shape1.setRotationPoint(0F, 0F, 0F);
|
||||
shape1.setTextureSize(8, 4);
|
||||
shape1.mirror = true;
|
||||
setRotation(shape1, 0F, 0F, 0F);
|
||||
this.shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.shape1.addBox(-1F, -3F, -1F, 2, 2, 2);
|
||||
this.shape1.setRotationPoint(0F, 0F, 0F);
|
||||
this.shape1.setTextureSize(8, 4);
|
||||
this.shape1.mirror = true;
|
||||
this.setRotation(this.shape1, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape1.render(f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.shape1.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ModelWandPart extends ModelWand {
|
||||
this.Cap.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Cap.setTextureSize(64, 32);
|
||||
this.Cap.mirror = true;
|
||||
setRotation(this.Cap, 0.0F, 0.0F, 0.0F);
|
||||
this.setRotation(this.Cap, 0.0F, 0.0F, 0.0F);
|
||||
|
||||
//this.CapBottom = new ModelRenderer(this, 0, 0);
|
||||
//this.CapBottom.addBox(-1.0F, -1.0F, -1.0F, 2, 2, 2);
|
||||
@@ -67,13 +67,13 @@ public class ModelWandPart extends ModelWand {
|
||||
this.Rod.setRotationPoint(0.0F, 2.0F, 0.0F);
|
||||
this.Rod.setTextureSize(64, 32);
|
||||
this.Rod.mirror = true;
|
||||
setRotation(this.Rod, 0.0F, 0.0F, 0.0F);
|
||||
this.setRotation(this.Rod, 0.0F, 0.0F, 0.0F);
|
||||
this.Focus = new ModelRenderer(this, 0, 0);
|
||||
this.Focus.addBox(-3.0F, -6.0F, -3.0F, 6, 6, 6);
|
||||
this.Focus.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Focus.setTextureSize(64, 32);
|
||||
this.Focus.mirror = true;
|
||||
setRotation(this.Focus, 0.0F, 0.0F, 0.0F);
|
||||
this.setRotation(this.Focus, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(ItemStack wandStack) {
|
||||
@@ -217,7 +217,7 @@ public class ModelWandPart extends ModelWand {
|
||||
for (int rot = 0; rot < 10; rot++) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(36 * rot + player.ticksExisted, 0.0D, 1.0D, 0.0D);
|
||||
drawRune(0.16D, -0.009999999776482582D, -0.125D, rot, player);
|
||||
this.drawRune(0.16D, -0.009999999776482582D, -0.125D, rot, player);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glBlendFunc(770, 771);
|
||||
@@ -237,8 +237,8 @@ public class ModelWandPart extends ModelWand {
|
||||
int rune = (a + rot * 3) % 16;
|
||||
|
||||
//edit start
|
||||
if(a < runeCount) {
|
||||
drawRune(0.36D + a * 0.14D, -0.009999999776482582D, -0.08D, rune, player);
|
||||
if(a < this.runeCount) {
|
||||
this.drawRune(0.36D + a * 0.14D, -0.009999999776482582D, -0.08D, rune, player);
|
||||
}
|
||||
//edit end
|
||||
}
|
||||
|
||||
+7
-7
@@ -50,23 +50,23 @@ public class BlockExtendedNodeJarRenderer implements ISimpleBlockRenderingHandle
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
IIcon i1 = ((BlockJar) ConfigBlocks.blockJar).iconJarTop;
|
||||
IIcon i2 = ((BlockJar) ConfigBlocks.blockJar).iconJarSide;
|
||||
block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13);
|
||||
block.setBlockBounds(BlockExtendedNodeJarRenderer.W3, 0.0F, BlockExtendedNodeJarRenderer.W3, BlockExtendedNodeJarRenderer.W13, BlockExtendedNodeJarRenderer.W12, BlockExtendedNodeJarRenderer.W13);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
|
||||
block.setBlockBounds(W5, W12, W5, W11, W14, W11);
|
||||
BlockExtendedNodeJarRenderer.drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
|
||||
block.setBlockBounds(BlockExtendedNodeJarRenderer.W5, BlockExtendedNodeJarRenderer.W12, BlockExtendedNodeJarRenderer.W5, BlockExtendedNodeJarRenderer.W11, BlockExtendedNodeJarRenderer.W14, BlockExtendedNodeJarRenderer.W11);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
|
||||
BlockExtendedNodeJarRenderer.drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int bb = setBrightness(world, x, y, z, block);
|
||||
int bb = this.setBrightness(world, x, y, z, block);
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13);
|
||||
block.setBlockBounds(BlockExtendedNodeJarRenderer.W3, 0.0F, BlockExtendedNodeJarRenderer.W3, BlockExtendedNodeJarRenderer.W13, BlockExtendedNodeJarRenderer.W12, BlockExtendedNodeJarRenderer.W13);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
block.setBlockBounds(W5, W12, W5, W11, W14, W11);
|
||||
block.setBlockBounds(BlockExtendedNodeJarRenderer.W5, BlockExtendedNodeJarRenderer.W12, BlockExtendedNodeJarRenderer.W5, BlockExtendedNodeJarRenderer.W11, BlockExtendedNodeJarRenderer.W14, BlockExtendedNodeJarRenderer.W11);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public abstract class BlockRenderingHandler implements ISimpleBlockRenderingHand
|
||||
}
|
||||
|
||||
protected void renderFace(ForgeDirection side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) {
|
||||
renderFace(side.ordinal(), renderer, block, x, y, z, icon);
|
||||
this.renderFace(side.ordinal(), renderer, block, x, y, z, icon);
|
||||
}
|
||||
|
||||
/*protected void renderFaceHollow(int side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon,
|
||||
|
||||
@@ -25,9 +25,9 @@ public class RenderBlockStoneMachine implements ISimpleBlockRenderingHandler {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
if(metadata == 1) {
|
||||
BlockStoneMachine blockStoneMachine = (BlockStoneMachine)block;
|
||||
DEVICE_BLOCK.iconPedestal[0] = blockStoneMachine.pedestalSideIcon;
|
||||
DEVICE_BLOCK.iconPedestal[1] = blockStoneMachine.pedestalTopIcon;
|
||||
DEVICE_RENDERER.renderInventoryBlock(DEVICE_BLOCK, 1, modelId, renderer);
|
||||
RenderBlockStoneMachine.DEVICE_BLOCK.iconPedestal[0] = blockStoneMachine.pedestalSideIcon;
|
||||
RenderBlockStoneMachine.DEVICE_BLOCK.iconPedestal[1] = blockStoneMachine.pedestalTopIcon;
|
||||
RenderBlockStoneMachine.DEVICE_RENDERER.renderInventoryBlock(RenderBlockStoneMachine.DEVICE_BLOCK, 1, modelId, renderer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RenderBlockStoneMachine implements ISimpleBlockRenderingHandler {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if(metadata == 1) {
|
||||
DEVICE_RENDERER.renderWorldBlock(world, x, y, z, block, modelId, renderer);
|
||||
RenderBlockStoneMachine.DEVICE_RENDERER.renderWorldBlock(world, x, y, z, block, modelId, renderer);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class RenderBlockTransparent extends BlockRenderingHandler {
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
if(block instanceof IBlockTransparent) {
|
||||
renderAllFaces(renderer, block, x, y, z, ((IBlockTransparent) block).getTransparentIcon());
|
||||
this.renderAllFaces(renderer, block, x, y, z, ((IBlockTransparent) block).getTransparentIcon());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ public class PlayerCameraRenderer extends EntityRenderer {
|
||||
private boolean isRemoved;
|
||||
private EntityRenderer prevRenderer;
|
||||
|
||||
public float xOffset = 0;
|
||||
public float yOffset = 0;
|
||||
public float zOffset = 0;
|
||||
public float xOffset;
|
||||
public float yOffset;
|
||||
public float zOffset;
|
||||
|
||||
public PlayerCameraRenderer(Minecraft minecraft, EntityRenderer prevRenderer) {
|
||||
super(minecraft, minecraft.getResourceManager());
|
||||
@@ -33,15 +33,15 @@ public class PlayerCameraRenderer extends EntityRenderer {
|
||||
}
|
||||
|
||||
public EntityRenderer getPrevRenderer() {
|
||||
return prevRenderer;
|
||||
return this.prevRenderer;
|
||||
}
|
||||
|
||||
public boolean isMarkedForRemoval() {
|
||||
return isMarkedForRemoval;
|
||||
return this.isMarkedForRemoval;
|
||||
}
|
||||
|
||||
public boolean isRemoved() {
|
||||
return isRemoved;
|
||||
return this.isRemoved;
|
||||
}
|
||||
|
||||
public void markForRemoval() {
|
||||
@@ -49,27 +49,27 @@ public class PlayerCameraRenderer extends EntityRenderer {
|
||||
}
|
||||
|
||||
private boolean canChangeView() {
|
||||
return !isMarkedForRemoval && minecraft.thePlayer != null && !minecraft.thePlayer.isRiding() && !minecraft.thePlayer.isPlayerSleeping();
|
||||
return !this.isMarkedForRemoval && this.minecraft.thePlayer != null && !this.minecraft.thePlayer.isRiding() && !this.minecraft.thePlayer.isPlayerSleeping();
|
||||
}
|
||||
|
||||
private void removeIfMarked() {
|
||||
if(isMarkedForRemoval && this.equals(Minecraft.getMinecraft().entityRenderer)) {
|
||||
Minecraft.getMinecraft().entityRenderer = prevRenderer;
|
||||
isRemoved = true;
|
||||
if(this.isMarkedForRemoval && this.equals(Minecraft.getMinecraft().entityRenderer)) {
|
||||
Minecraft.getMinecraft().entityRenderer = this.prevRenderer;
|
||||
this.isRemoved = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCameraAndRender(float partialTicks) {
|
||||
removeIfMarked();
|
||||
this.removeIfMarked();
|
||||
|
||||
if(canChangeView()) {
|
||||
moveCam(-1);
|
||||
if(this.canChangeView()) {
|
||||
this.moveCam(-1);
|
||||
//float tempEyeHeight = minecraft.thePlayer.eyeHeight;
|
||||
//minecraft.thePlayer.eyeHeight = minecraft.thePlayer.getDefaultEyeHeight();
|
||||
super.updateCameraAndRender(partialTicks);
|
||||
//minecraft.thePlayer.eyeHeight = tempEyeHeight;
|
||||
moveCam(1);
|
||||
this.moveCam(1);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class PlayerCameraRenderer extends EntityRenderer {
|
||||
}
|
||||
|
||||
private void moveCam(int mod) {
|
||||
EntityPlayer player = minecraft.thePlayer;
|
||||
EntityPlayer player = this.minecraft.thePlayer;
|
||||
|
||||
player.posX += this.xOffset * mod;
|
||||
player.lastTickPosX += this.xOffset * mod;
|
||||
@@ -95,12 +95,12 @@ public class PlayerCameraRenderer extends EntityRenderer {
|
||||
|
||||
@Override
|
||||
public void getMouseOver(float partialTicks) {
|
||||
removeIfMarked();
|
||||
this.removeIfMarked();
|
||||
|
||||
if(canChangeView()) {
|
||||
moveCam(-1);
|
||||
if(this.canChangeView()) {
|
||||
this.moveCam(-1);
|
||||
super.getMouseOver(partialTicks);
|
||||
moveCam(1);
|
||||
this.moveCam(1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
+7
-7
@@ -20,7 +20,7 @@ import thaumcraft.common.entities.golems.EntityGolemBase;
|
||||
* Created by makeo @ 12.03.2015 15:57
|
||||
*/
|
||||
public class RenderAdditionalGolemBase extends RenderGolemBase {
|
||||
private ItemStack toolItem = null;
|
||||
private ItemStack toolItem;
|
||||
|
||||
public RenderAdditionalGolemBase() {
|
||||
super(new ModelGolem(false));
|
||||
@@ -44,8 +44,8 @@ public class RenderAdditionalGolemBase extends RenderGolemBase {
|
||||
if (RenderGolemHelper.requiresRenderFix((EntityGolemBase) entity)) {
|
||||
RenderGolemHelper.renderCarriedItemsFix(golem);
|
||||
|
||||
if(toolItem != null) {
|
||||
RenderGolemHelper.renderToolItem(golem, toolItem, mainModel, renderManager);
|
||||
if(this.toolItem != null) {
|
||||
RenderGolemHelper.renderToolItem(golem, this.toolItem, this.mainModel, this.renderManager);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ public class RenderAdditionalGolemBase extends RenderGolemBase {
|
||||
@Override
|
||||
protected void renderCarriedItems(EntityGolemBase golem, float par2) {
|
||||
if (!RenderGolemHelper.requiresRenderFix(golem)) {
|
||||
if(toolItem != null) {
|
||||
RenderGolemHelper.renderToolItem(golem, toolItem, mainModel, renderManager);
|
||||
if(this.toolItem != null) {
|
||||
RenderGolemHelper.renderToolItem(golem, this.toolItem, this.mainModel, this.renderManager);
|
||||
}
|
||||
super.renderCarriedItems(golem, par2);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class RenderAdditionalGolemBase extends RenderGolemBase {
|
||||
AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(golem);
|
||||
ItemStack carriedItem = null;
|
||||
if(core != null) {
|
||||
toolItem = core.getToolItem(golem);
|
||||
this.toolItem = core.getToolItem(golem);
|
||||
|
||||
carriedItem = golem.getCarriedForDisplay();
|
||||
golem.getDataWatcher().getWatchedObject(16).setObject(null);
|
||||
@@ -82,7 +82,7 @@ public class RenderAdditionalGolemBase extends RenderGolemBase {
|
||||
|
||||
if(carriedItem != null) {
|
||||
golem.getDataWatcher().getWatchedObject(16).setObject(carriedItem);
|
||||
toolItem = null;
|
||||
this.toolItem = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class RenderEntityItem extends Render {
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float parf1, float parf2) {
|
||||
if(!(entity instanceof EntityItem)) return;
|
||||
ri.doRender(entity, x, y, z, parf1, parf2);
|
||||
RenderEntityItem.ri.doRender(entity, x, y, z, parf1, parf2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,8 +32,8 @@ public class RenderEntityItem extends Render {
|
||||
}
|
||||
|
||||
static {
|
||||
ri = new RenderItem();
|
||||
ri.setRenderManager(RenderManager.instance);
|
||||
RenderEntityItem.ri = new RenderItem();
|
||||
RenderEntityItem.ri.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,6 +24,6 @@ public class ItemCreativeNodeRenderer extends ItemExNodeRenderer {
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
makeo.gadomancy.client.renderers.item.ItemNodeRenderer.renderNodeItem(type, item, ASPECTS, NodeType.values()[item.getItemDamage()], null, data);
|
||||
makeo.gadomancy.client.renderers.item.ItemNodeRenderer.renderNodeItem(type, item, ItemCreativeNodeRenderer.ASPECTS, NodeType.values()[item.getItemDamage()], null, data);
|
||||
}
|
||||
}
|
||||
+1
-4
@@ -33,10 +33,7 @@ public class ItemJarExtendedNodeRenderer implements IItemRenderer {
|
||||
}
|
||||
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
if (helper == IItemRenderer.ItemRendererHelper.EQUIPPED_BLOCK) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return helper != ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
|
||||
RenderBlocks rb = new RenderBlocks();
|
||||
|
||||
@@ -33,16 +33,13 @@ public class ItemNodeRenderer implements IItemRenderer {
|
||||
}
|
||||
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
if (helper == IItemRenderer.ItemRendererHelper.EQUIPPED_BLOCK) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return helper != ItemRendererHelper.EQUIPPED_BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
//Gadomancy: Redirect.
|
||||
renderNodeItem(type, item, data);
|
||||
ItemNodeRenderer.renderNodeItem(type, item, data);
|
||||
}
|
||||
|
||||
//Gadomancy: Renamed to access it static from another class and added aspects, nodeType and nodeModifier as params
|
||||
@@ -60,18 +57,18 @@ public class ItemNodeRenderer implements IItemRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.5D, 0.5D, 0.5D);
|
||||
GL11.glScaled(2.0D, 2.0D, 2.0D);
|
||||
renderItemNode(tjf);
|
||||
ItemNodeRenderer.renderItemNode(tjf);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
renderItemNode(tjf);
|
||||
ItemNodeRenderer.renderItemNode(tjf);
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
renderItemNode(tjf);
|
||||
ItemNodeRenderer.renderItemNode(tjf);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(32826);
|
||||
}
|
||||
|
||||
|
||||
public static void renderNodeItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
renderNodeItem(type, item, aspects, NodeType.NORMAL, null, data);
|
||||
ItemNodeRenderer.renderNodeItem(type, item, ItemNodeRenderer.aspects, NodeType.NORMAL, null, data);
|
||||
}
|
||||
|
||||
private static AspectList aspects = new AspectList().add(Aspect.AIR, 40).add(Aspect.FIRE, 40).add(Aspect.EARTH, 40).add(Aspect.WATER, 40);
|
||||
|
||||
@@ -7,9 +7,6 @@ import makeo.gadomancy.common.utils.world.fake.FakeWorld;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -19,7 +16,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.client.renderers.entity.RenderWisp;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.monster.EntityWisp;
|
||||
|
||||
@@ -36,7 +32,7 @@ import java.util.Random;
|
||||
*/
|
||||
public class ItemRenderFamiliar implements IItemRenderer {
|
||||
|
||||
private static EntityWisp ENTITY_WISP = null;
|
||||
private static EntityWisp ENTITY_WISP;
|
||||
private float[] renderInfo = new float[5];
|
||||
|
||||
@Override
|
||||
@@ -62,26 +58,26 @@ public class ItemRenderFamiliar implements IItemRenderer {
|
||||
}
|
||||
|
||||
try {
|
||||
cleanActiveRenderInfo(type);
|
||||
this.cleanActiveRenderInfo(type);
|
||||
GL11.glScalef(1.3F, 1.3F, 1.3F);
|
||||
if(ItemEtherealFamiliar.hasFamiliarAspect(item)) {
|
||||
if(ENTITY_WISP == null) ENTITY_WISP = new EntityWisp(new FakeWorld());
|
||||
ENTITY_WISP.ticksExisted = FamiliarHandlerClient.PartialEntityFamiliar.DUMMY_FAMILIAR.ticksExisted;
|
||||
ENTITY_WISP.setType(ItemEtherealFamiliar.getFamiliarAspect(item).getTag());
|
||||
renderEntityWispFor(null, ENTITY_WISP, 0, 0, 0, 0, 0);
|
||||
if(ItemRenderFamiliar.ENTITY_WISP == null) ItemRenderFamiliar.ENTITY_WISP = new EntityWisp(new FakeWorld());
|
||||
ItemRenderFamiliar.ENTITY_WISP.ticksExisted = FamiliarHandlerClient.PartialEntityFamiliar.DUMMY_FAMILIAR.ticksExisted;
|
||||
ItemRenderFamiliar.ENTITY_WISP.setType(ItemEtherealFamiliar.getFamiliarAspect(item).getTag());
|
||||
ItemRenderFamiliar.renderEntityWispFor(null, ItemRenderFamiliar.ENTITY_WISP, 0, 0, 0, 0, 0);
|
||||
}
|
||||
} finally {
|
||||
restoreActiveRenderInfo();
|
||||
this.restoreActiveRenderInfo();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private void cleanActiveRenderInfo(ItemRenderType renderType) {
|
||||
renderInfo[0] = ActiveRenderInfo.rotationX;
|
||||
renderInfo[1] = ActiveRenderInfo.rotationXZ;
|
||||
renderInfo[2] = ActiveRenderInfo.rotationZ;
|
||||
renderInfo[3] = ActiveRenderInfo.rotationYZ;
|
||||
renderInfo[4] = ActiveRenderInfo.rotationXY;
|
||||
this.renderInfo[0] = ActiveRenderInfo.rotationX;
|
||||
this.renderInfo[1] = ActiveRenderInfo.rotationXZ;
|
||||
this.renderInfo[2] = ActiveRenderInfo.rotationZ;
|
||||
this.renderInfo[3] = ActiveRenderInfo.rotationYZ;
|
||||
this.renderInfo[4] = ActiveRenderInfo.rotationXY;
|
||||
switch (renderType) {
|
||||
case ENTITY:
|
||||
break;
|
||||
@@ -112,20 +108,20 @@ public class ItemRenderFamiliar implements IItemRenderer {
|
||||
}
|
||||
|
||||
private void restoreActiveRenderInfo() {
|
||||
if(renderInfo[0] != -1) ActiveRenderInfo.rotationX = renderInfo[0];
|
||||
if(renderInfo[1] != -1) ActiveRenderInfo.rotationXZ = renderInfo[1];
|
||||
if(renderInfo[2] != -1) ActiveRenderInfo.rotationZ = renderInfo[2];
|
||||
if(renderInfo[3] != -1) ActiveRenderInfo.rotationYZ = renderInfo[3];
|
||||
if(renderInfo[4] != -1) ActiveRenderInfo.rotationXY = renderInfo[4];
|
||||
for (int i = 0; i < renderInfo.length; i++) {
|
||||
renderInfo[i] = -1;
|
||||
if(this.renderInfo[0] != -1) ActiveRenderInfo.rotationX = this.renderInfo[0];
|
||||
if(this.renderInfo[1] != -1) ActiveRenderInfo.rotationXZ = this.renderInfo[1];
|
||||
if(this.renderInfo[2] != -1) ActiveRenderInfo.rotationZ = this.renderInfo[2];
|
||||
if(this.renderInfo[3] != -1) ActiveRenderInfo.rotationYZ = this.renderInfo[3];
|
||||
if(this.renderInfo[4] != -1) ActiveRenderInfo.rotationXY = this.renderInfo[4];
|
||||
for (int i = 0; i < this.renderInfo.length; i++) {
|
||||
this.renderInfo[i] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static int size1 = 0;
|
||||
private static int size1;
|
||||
public static void renderEntityWispFor(EntityPlayer owner, EntityWisp wisp, double x, double y, double z, float fq, float pticks) {
|
||||
if (size1 == 0) {
|
||||
size1 = UtilsFX.getTextureSize("textures/misc/wisp.png", 64);
|
||||
if (ItemRenderFamiliar.size1 == 0) {
|
||||
ItemRenderFamiliar.size1 = UtilsFX.getTextureSize("textures/misc/wisp.png", 64);
|
||||
}
|
||||
|
||||
float f1 = ActiveRenderInfo.rotationX;
|
||||
@@ -180,13 +176,13 @@ public class ItemRenderFamiliar implements IItemRenderer {
|
||||
|
||||
int i = wisp.ticksExisted % 16;
|
||||
|
||||
float size4 = size1 * 4;
|
||||
float float_sizeMinus0_01 = size1 - 0.01F;
|
||||
float size4 = ItemRenderFamiliar.size1 * 4;
|
||||
float float_sizeMinus0_01 = ItemRenderFamiliar.size1 - 0.01F;
|
||||
|
||||
float x0 = (i % 4 * size1 + 0.0F) / size4;
|
||||
float x1 = (i % 4 * size1 + float_sizeMinus0_01) / size4;
|
||||
float x2 = (i / 4 * size1 + 0.0F) / size4;
|
||||
float x3 = (i / 4 * size1 + float_sizeMinus0_01) / size4;
|
||||
float x0 = (i % 4 * ItemRenderFamiliar.size1 + 0.0F) / size4;
|
||||
float x1 = (i % 4 * ItemRenderFamiliar.size1 + float_sizeMinus0_01) / size4;
|
||||
float x2 = (i / 4 * ItemRenderFamiliar.size1 + 0.0F) / size4;
|
||||
float x3 = (i / 4 * ItemRenderFamiliar.size1 + float_sizeMinus0_01) / size4;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
@@ -32,15 +32,15 @@ public class ItemRenderRemoteJar extends ItemRenderTileEntity<TileRemoteJar> {
|
||||
|
||||
AspectList aspects = ((ItemJarFilled)ConfigItems.itemJarFilled).getAspects(stack);
|
||||
if(aspects != null) {
|
||||
tile.aspect = aspects.getAspects()[0];
|
||||
tile.amount = aspects.getAmount(tile.aspect);
|
||||
this.tile.aspect = aspects.getAspects()[0];
|
||||
this.tile.amount = aspects.getAmount(this.tile.aspect);
|
||||
} else {
|
||||
tile.aspect = null;
|
||||
tile.amount = 0;
|
||||
this.tile.aspect = null;
|
||||
this.tile.amount = 0;
|
||||
}
|
||||
|
||||
if(stack.hasTagCompound()) {
|
||||
tile.networkId = NBTHelper.getUUID(stack.getTagCompound(), "networkId");
|
||||
this.tile.networkId = NBTHelper.getUUID(stack.getTagCompound(), "networkId");
|
||||
}
|
||||
|
||||
super.renderItem(type, stack, data);
|
||||
|
||||
@@ -30,19 +30,19 @@ public class ItemRenderStoneMachine extends ItemRenderTileEntity<TileEntity> {
|
||||
RenderInfo info = new RenderInfo();
|
||||
info.renderer = renderer;
|
||||
info.tile = tile;
|
||||
renderers.put(metadata, info);
|
||||
this.renderers.put(metadata, info);
|
||||
|
||||
if(tile.getWorldObj() == null) {
|
||||
tile.setWorldObj(FAKE_WORLD);
|
||||
tile.setWorldObj(ItemRenderTileEntity.FAKE_WORLD);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack stack, Object... data) {
|
||||
RenderInfo info = renderers.get(stack.getItemDamage());
|
||||
RenderInfo info = this.renderers.get(stack.getItemDamage());
|
||||
|
||||
tile = info.tile;
|
||||
renderer = info.renderer;
|
||||
this.tile = info.tile;
|
||||
this.renderer = info.renderer;
|
||||
|
||||
if(stack.getItemDamage() == 0) {
|
||||
GL11.glTranslatef(0, 2/16f, 0);
|
||||
@@ -53,6 +53,6 @@ public class ItemRenderStoneMachine extends ItemRenderTileEntity<TileEntity> {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack stack, ItemRenderType type) {
|
||||
return renderers.containsKey(stack.getItemDamage());
|
||||
return this.renderers.containsKey(stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ItemRenderTileEntity<T extends TileEntity> implements IItemRenderer
|
||||
this.tile = tile;
|
||||
|
||||
if(tile.getWorldObj() == null) {
|
||||
tile.setWorldObj(FAKE_WORLD);
|
||||
tile.setWorldObj(ItemRenderTileEntity.FAKE_WORLD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ public class ItemRenderTileEntity<T extends TileEntity> implements IItemRenderer
|
||||
if(type == ItemRenderType.INVENTORY)
|
||||
GL11.glTranslatef(0, -0.1F, 0);
|
||||
|
||||
if(type == ItemRenderType.EQUIPPED_FIRST_PERSON && tile instanceof TileManipulationFocus)
|
||||
if(type == ItemRenderType.EQUIPPED_FIRST_PERSON && this.tile instanceof TileManipulationFocus)
|
||||
GL11.glTranslatef(0, 0.6F, 0);
|
||||
|
||||
this.renderer.renderTileEntityAt(tile, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
this.renderer.renderTileEntityAt(this.tile, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class ItemRenderTileEntityMulti implements IItemRenderer {
|
||||
public ItemRenderTileEntityMulti(RenderSet... renderSets) {
|
||||
for(RenderSet set : renderSets) {
|
||||
if(set != null) {
|
||||
renderMap.put(set.meta, set);
|
||||
this.renderMap.put(set.meta, set);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,8 +48,8 @@ public class ItemRenderTileEntityMulti implements IItemRenderer {
|
||||
if(type == ItemRenderType.INVENTORY)
|
||||
GL11.glTranslatef(0, -0.1F, 0);
|
||||
|
||||
if(renderMap.containsKey(item.getItemDamage())) {
|
||||
RenderSet set = renderMap.get(item.getItemDamage());
|
||||
if(this.renderMap.containsKey(item.getItemDamage())) {
|
||||
RenderSet set = this.renderMap.get(item.getItemDamage());
|
||||
set.renderer.renderTileEntityAt(set.te, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
TileAIShutdown ta = (TileAIShutdown) tileEntity;
|
||||
|
||||
if(ta.getStoredEssentia() > 0) {
|
||||
handleOrbital(ta);
|
||||
this.handleOrbital(ta);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
|
||||
if(ta.getStoredEssentia() > 0) {
|
||||
if(ta.orbital != null && ta.orbital.orbitalsSize() == 0) {
|
||||
fillOrbital(ta.orbital);
|
||||
this.fillOrbital(ta.orbital);
|
||||
}
|
||||
} else {
|
||||
if(ta.orbital != null && ta.orbital.orbitalsSize() > 0) {
|
||||
@@ -63,9 +63,9 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() {
|
||||
@Override
|
||||
public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, int orbitalExisted, float partialTicks) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
if(RenderTileAIShutdown.rand.nextInt(3) == 0) {
|
||||
FXWisp ef = new FXWisp(world,
|
||||
pos.getX() + randomOffset(), pos.getY() + randomOffset(), pos.getZ() + randomOffset(),
|
||||
pos.getX() + RenderTileAIShutdown.randomOffset(), pos.getY() + RenderTileAIShutdown.randomOffset(), pos.getZ() + RenderTileAIShutdown.randomOffset(),
|
||||
0.2F, 3);
|
||||
ef.setGravity(-0.08F);
|
||||
ParticleEngine.instance.addEffect(world, ef);
|
||||
@@ -80,9 +80,9 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() {
|
||||
@Override
|
||||
public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, int orbitalExisted, float partialTicks) {
|
||||
if(rand.nextInt(3) == 0) {
|
||||
if(RenderTileAIShutdown.rand.nextInt(3) == 0) {
|
||||
FXWisp ef = new FXWisp(world,
|
||||
pos.getX() + randomOffset(), pos.getY() + randomOffset(), pos.getZ() + randomOffset(),
|
||||
pos.getX() + RenderTileAIShutdown.randomOffset(), pos.getY() + RenderTileAIShutdown.randomOffset(), pos.getZ() + RenderTileAIShutdown.randomOffset(),
|
||||
0.2F, 3);
|
||||
ef.setGravity(-0.08F);
|
||||
ParticleEngine.instance.addEffect(world, ef);
|
||||
@@ -97,9 +97,9 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() {
|
||||
@Override
|
||||
public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, int orbitalExisted, float partialTicks) {
|
||||
if(rand.nextBoolean()) {
|
||||
if(RenderTileAIShutdown.rand.nextBoolean()) {
|
||||
FXWisp ef = new FXWisp(world,
|
||||
pos.getX() + randomOffset(), pos.getY() + randomOffset(), pos.getZ() + randomOffset(),
|
||||
pos.getX() + RenderTileAIShutdown.randomOffset(), pos.getY() + RenderTileAIShutdown.randomOffset(), pos.getZ() + RenderTileAIShutdown.randomOffset(),
|
||||
0.15F, 5);
|
||||
ef.setGravity(-0.08F);
|
||||
ParticleEngine.instance.addEffect(world, ef);
|
||||
@@ -114,9 +114,9 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() {
|
||||
@Override
|
||||
public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, int orbitalExisted, float partialTicks) {
|
||||
if(rand.nextBoolean()) {
|
||||
if(RenderTileAIShutdown.rand.nextBoolean()) {
|
||||
FXWisp ef = new FXWisp(world,
|
||||
pos.getX() + randomOffset(), pos.getY() + randomOffset(), pos.getZ() + randomOffset(),
|
||||
pos.getX() + RenderTileAIShutdown.randomOffset(), pos.getY() + RenderTileAIShutdown.randomOffset(), pos.getZ() + RenderTileAIShutdown.randomOffset(),
|
||||
0.15F, 5);
|
||||
ef.setGravity(-0.08F);
|
||||
ParticleEngine.instance.addEffect(world, ef);
|
||||
@@ -131,9 +131,9 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() {
|
||||
@Override
|
||||
public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, int orbitalExisted, float partialTicks) {
|
||||
if(rand.nextBoolean()) {
|
||||
if(RenderTileAIShutdown.rand.nextBoolean()) {
|
||||
FXWisp ef = new FXWisp(world,
|
||||
pos.getX() + randomOffset(), pos.getY() + randomOffset(), pos.getZ() + randomOffset(),
|
||||
pos.getX() + RenderTileAIShutdown.randomOffset(), pos.getY() + RenderTileAIShutdown.randomOffset(), pos.getZ() + RenderTileAIShutdown.randomOffset(),
|
||||
0.15F, 5);
|
||||
ef.setGravity(-0.08F);
|
||||
ParticleEngine.instance.addEffect(world, ef);
|
||||
@@ -145,7 +145,7 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
private static float randomOffset() {
|
||||
return rand.nextFloat() * 0.2F;
|
||||
return RenderTileAIShutdown.rand.nextFloat() * 0.2F;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,12 +53,12 @@ public class RenderTileArcaneDropper extends TileEntitySpecialRenderer {
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
}
|
||||
|
||||
bindTexture(RESOURCE);
|
||||
MODEL.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
this.bindTexture(RenderTileArcaneDropper.RESOURCE);
|
||||
RenderTileArcaneDropper.MODEL.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
|
||||
renderBellow();
|
||||
this.renderBellow();
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
renderBellow();
|
||||
this.renderBellow();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class RenderTileArcaneDropper extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(-0.05f, 0.03f, 0f);
|
||||
GL11.glScalef(0.6f, 0.44f, 0.55f);
|
||||
|
||||
BELLOWS_RENDERER.renderEntityAt(BELLOWS_TILE, 0, 0, 0, 0);
|
||||
RenderTileArcaneDropper.BELLOWS_RENDERER.renderEntityAt(RenderTileArcaneDropper.BELLOWS_TILE, 0, 0, 0, 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -54,18 +54,18 @@ public class RenderTileArcanePackager extends TileEntitySpecialRenderer {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
bindTexture(TEXTURE_PISTON);
|
||||
this.bindTexture(RenderTileArcanePackager.TEXTURE_PISTON);
|
||||
|
||||
if(pistonOffset < 1/16f) {
|
||||
MODEL_PISTON_CUT.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
RenderTileArcanePackager.MODEL_PISTON_CUT.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
} else {
|
||||
MODEL_PISTON.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
RenderTileArcanePackager.MODEL_PISTON.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
bindTexture(TEXTURE);
|
||||
MODEL.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
this.bindTexture(RenderTileArcanePackager.TEXTURE);
|
||||
RenderTileArcanePackager.MODEL.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -15,10 +15,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXEssentiaTrail;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -48,20 +46,20 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
ResourceLocation textureToBind;
|
||||
if(tile instanceof TileAuraPylonTop) {
|
||||
textureToBind = PYLON_TEXTURE_TOP;
|
||||
textureToBind = RenderTileAuraPylon.PYLON_TEXTURE_TOP;
|
||||
} else if(((TileAuraPylon) tile).isInputTile() || ((TileAuraPylon) tile).isLowestTile()) {
|
||||
textureToBind = PYLON_TEXTURE_BOTTOM;
|
||||
textureToBind = RenderTileAuraPylon.PYLON_TEXTURE_BOTTOM;
|
||||
} else {
|
||||
textureToBind = PYLON_TEXTURE;
|
||||
textureToBind = RenderTileAuraPylon.PYLON_TEXTURE;
|
||||
}
|
||||
bindTexture(textureToBind);
|
||||
this.bindTexture(textureToBind);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
if(tile instanceof TileAuraPylonTop) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
GL11.glTranslatef(0, -2F, 0);
|
||||
//bindTexture(PYLON_TEXTURE_TOP);
|
||||
MODEL_AURA_PYLON_TOP.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileAuraPylon.MODEL_AURA_PYLON_TOP.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
if(((TileAuraPylon) tile).isInputTile() || ((TileAuraPylon) tile).isLowestTile()) {
|
||||
@@ -69,11 +67,11 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer {
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
GL11.glTranslatef(0, -2F, 0);
|
||||
//bindTexture(PYLON_TEXTURE_BOTTOM);
|
||||
MODEL_AURA_PYLON_BOTTOM.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileAuraPylon.MODEL_AURA_PYLON_BOTTOM.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
//bindTexture(PYLON_TEXTURE);
|
||||
MODEL_AURA_PYLON.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileAuraPylon.MODEL_AURA_PYLON.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,17 +96,17 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer {
|
||||
Color c = new Color(a.getColor());
|
||||
if(tile.getWorldObj().rand.nextInt(12) == 0) {
|
||||
if(a == Aspect.ENTROPY || a == Aspect.DARKNESS || a == Aspect.UNDEAD) {
|
||||
spawnWispParticles((TileAuraPylonTop) tile, 5, 0.5F, false);
|
||||
this.spawnWispParticles((TileAuraPylonTop) tile, 5, 0.5F, false);
|
||||
} else {
|
||||
spawnWispParticles((TileAuraPylonTop) tile, c, 0.5F, false);
|
||||
this.spawnWispParticles((TileAuraPylonTop) tile, c, 0.5F, false);
|
||||
}
|
||||
}
|
||||
c = c.darker().darker();
|
||||
if(tile.getWorldObj().rand.nextInt(20) == 0) {
|
||||
if(a == Aspect.ENTROPY || a == Aspect.DARKNESS || a == Aspect.UNDEAD) {
|
||||
spawnWispParticles((TileAuraPylonTop) tile, 5, 0.25F, false);
|
||||
this.spawnWispParticles((TileAuraPylonTop) tile, 5, 0.25F, false);
|
||||
} else {
|
||||
spawnWispParticles((TileAuraPylonTop) tile, c, 0.25F, false);
|
||||
this.spawnWispParticles((TileAuraPylonTop) tile, c, 0.25F, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,9 +121,9 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer {
|
||||
col |= (0x55 << 24);
|
||||
Color c = new Color(col, true);
|
||||
Random rand = tile.getWorldObj().rand;
|
||||
addNewOrbitalPoint(ta.orbital, rand, c);
|
||||
addNewOrbitalPoint(ta.orbital, rand, c);
|
||||
addNewOrbitalPoint(ta.orbital, rand, c);
|
||||
this.addNewOrbitalPoint(ta.orbital, rand, c);
|
||||
this.addNewOrbitalPoint(ta.orbital, rand, c);
|
||||
this.addNewOrbitalPoint(ta.orbital, rand, c);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -174,7 +172,7 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partTicks) {
|
||||
renderTileEntity(tileEntity, x, y, z, partTicks);
|
||||
this.renderTileEntity(tileEntity, x, y, z, partTicks);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class RenderTileBlockProtector extends TileJarRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
|
||||
renderTileEntityAt((TileBlockProtector)tile, x, y, z, partialTicks);
|
||||
this.renderTileEntityAt((TileBlockProtector)tile, x, y, z, partialTicks);
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileBlockProtector tile, double x, double y, double z, float partialTicks) {
|
||||
@@ -51,7 +51,7 @@ public class RenderTileBlockProtector extends TileJarRenderer {
|
||||
GL11.glTranslatef(0.5f, 1.5f, 0.5f);
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
|
||||
bindTexture(tile.getPowerLevel() > 0 ? TEXTURE_ON : TEXTURE_OFF);
|
||||
this.bindTexture(tile.getPowerLevel() > 0 ? RenderTileBlockProtector.TEXTURE_ON : RenderTileBlockProtector.TEXTURE_OFF);
|
||||
new ModelBlockProtector().render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RenderTileBlockProtector extends TileJarRenderer {
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glTranslatef(-0.5f, 0, 0.5f);
|
||||
|
||||
bindTexture(new ResourceLocation("thaumcraft", "textures/models/jar.png"));
|
||||
this.bindTexture(new ResourceLocation("thaumcraft", "textures/models/jar.png"));
|
||||
new ModelJar().renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
+10
-26
@@ -2,34 +2,18 @@ package makeo.gadomancy.client.renderers.tile;
|
||||
|
||||
import makeo.gadomancy.client.effect.EffectHandler;
|
||||
import makeo.gadomancy.client.effect.fx.FXVortex;
|
||||
import makeo.gadomancy.client.events.ClientHandler;
|
||||
import makeo.gadomancy.client.models.ModelPackedCompressorBlock;
|
||||
import makeo.gadomancy.client.models.ModelEssentiaCompressor;
|
||||
import makeo.gadomancy.client.models.ModelPackedCompressorBlock;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileEssentiaCompressor;
|
||||
import makeo.gadomancy.common.utils.MiscUtils;
|
||||
import makeo.gadomancy.common.utils.SimpleResourceLocation;
|
||||
import makeo.gadomancy.common.utils.Vector3;
|
||||
import makeo.gadomancy.common.utils.world.fake.FakeWorld;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.lib.QuadHelper;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -58,17 +42,17 @@ public class RenderTileEssentiaCompressor extends TileEntitySpecialRenderer {
|
||||
int yOffset = ((TileEssentiaCompressor) tileEntity).getMultiblockYIndex();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y - yOffset - 0.5, z + 0.5);
|
||||
bindTexture(COMPRESSOR_TEXTURE);
|
||||
this.bindTexture(RenderTileEssentiaCompressor.COMPRESSOR_TEXTURE);
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
GL11.glTranslatef(0, -2F, 0);
|
||||
MODEL_ESSENTIA_COMPRESSOR.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileEssentiaCompressor.MODEL_ESSENTIA_COMPRESSOR.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
MODEL_ESSENTIA_COMPRESSOR.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileEssentiaCompressor.MODEL_ESSENTIA_COMPRESSOR.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
if(yOffset == 1) { //The middle one. - well. the one where the blackhole is.
|
||||
renderBlackHoleEffect(tileEntity.xCoord + 0.5, tileEntity.yCoord + 0.5, tileEntity.zCoord + 0.5,
|
||||
this.renderBlackHoleEffect(tileEntity.xCoord + 0.5, tileEntity.yCoord + 0.5, tileEntity.zCoord + 0.5,
|
||||
(TileEssentiaCompressor) tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord - 1, tileEntity.zCoord));
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
@@ -81,8 +65,8 @@ public class RenderTileEssentiaCompressor extends TileEntitySpecialRenderer {
|
||||
} else {
|
||||
GL11.glTranslatef(0, -2.877F, 0);
|
||||
}
|
||||
bindTexture(PACKED_COMPRESSOR_TEXTURE);
|
||||
MODEL_PACKED_COMPRESSOR.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
this.bindTexture(RenderTileEssentiaCompressor.PACKED_COMPRESSOR_TEXTURE);
|
||||
RenderTileEssentiaCompressor.MODEL_PACKED_COMPRESSOR.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -93,11 +77,11 @@ public class RenderTileEssentiaCompressor extends TileEntitySpecialRenderer {
|
||||
private void renderBlackHoleEffect(double x, double y, double z, TileEssentiaCompressor te) {
|
||||
ChunkCoordinates cc = new ChunkCoordinates((int) x, (int) y, (int) z);
|
||||
FXVortex v;
|
||||
if (ownedVortex.containsKey(cc)) {
|
||||
v = ownedVortex.get(cc);
|
||||
if (RenderTileEssentiaCompressor.ownedVortex.containsKey(cc)) {
|
||||
v = RenderTileEssentiaCompressor.ownedVortex.get(cc);
|
||||
} else {
|
||||
v = new FXVortex(x, y, z, te);
|
||||
ownedVortex.put(cc, v);
|
||||
RenderTileEssentiaCompressor.ownedVortex.put(cc, v);
|
||||
v.registered = true;
|
||||
EffectHandler.getInstance().registerVortex(v);
|
||||
}
|
||||
|
||||
@@ -43,19 +43,19 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
|
||||
static {
|
||||
MODELS = new ModelInfusionClawPart[8];
|
||||
for (int i = 0; i < MODELS.length; i++) {
|
||||
MODELS[i] = new ModelInfusionClawPart(i);
|
||||
for (int i = 0; i < RenderTileInfusionClaw.MODELS.length; i++) {
|
||||
RenderTileInfusionClaw.MODELS[i] = new ModelInfusionClawPart(i);
|
||||
}
|
||||
|
||||
new Injector(WAND_RENDERER).setField("model", new ModelWandPart(7, 4));
|
||||
new Injector(STAFF_RENDERER).setField("model", new ModelWandPart(7, 4));
|
||||
new Injector(RenderTileInfusionClaw.WAND_RENDERER).setField("model", new ModelWandPart(7, 4));
|
||||
new Injector(RenderTileInfusionClaw.STAFF_RENDERER).setField("model", new ModelWandPart(7, 4));
|
||||
|
||||
RENDER_PRIMAL_ORB.setRenderManager(RenderManager.instance);
|
||||
RenderTileInfusionClaw.RENDER_PRIMAL_ORB.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
|
||||
render((TileInfusionClaw) tile, x, y, z, partialTicks);
|
||||
this.render((TileInfusionClaw) tile, x, y, z, partialTicks);
|
||||
}
|
||||
|
||||
private void render(TileInfusionClaw tile, double x, double y, double z, float partialTicks) {
|
||||
@@ -66,9 +66,9 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslated(x, y, z);
|
||||
renderPart(tile, elapsed, ticks);
|
||||
this.renderPart(tile, elapsed, ticks);
|
||||
|
||||
renderPrimalOrb(tile, elapsed);
|
||||
this.renderPrimalOrb(tile, elapsed);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -78,13 +78,13 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
|
||||
World world = tile.getWorldObj();
|
||||
bindTexture(RESOURCE);
|
||||
this.bindTexture(RenderTileInfusionClaw.RESOURCE);
|
||||
|
||||
renderSides(tile, world, tile.xCoord, tile.yCoord, tile.zCoord, elapsed);
|
||||
this.renderSides(tile, world, tile.xCoord, tile.yCoord, tile.zCoord, elapsed);
|
||||
|
||||
renderCircle(tile, elapsed);
|
||||
this.renderCircle(tile, elapsed);
|
||||
|
||||
renderWand(tile.getStackInSlot(0), ticks);
|
||||
this.renderWand(tile.getStackInSlot(0), ticks);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
GL11.glRotated(45, Math.cos(angle), 0, -Math.sin(angle));
|
||||
GL11.glScalef(0.75f, 0.75f, 0.75f);
|
||||
|
||||
renderPart(i);
|
||||
this.renderPart(i);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
private void renderWand(ItemStack wandStack, float ticks) {
|
||||
GL11.glRotatef(((ticks/3) / 20.0F) * (180F / (float)Math.PI), 0, 1f, 0);
|
||||
|
||||
renderTopPart();
|
||||
this.renderTopPart();
|
||||
|
||||
if (wandStack != null && wandStack.stackSize > 0) {
|
||||
GL11.glPushMatrix();
|
||||
@@ -159,9 +159,9 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
if(item.isStaff(wandFocusStack)) {
|
||||
GL11.glTranslatef(0, -0.5f, 0);
|
||||
|
||||
STAFF_RENDERER.renderItem(IItemRenderer.ItemRenderType.ENTITY, wandFocusStack);
|
||||
RenderTileInfusionClaw.STAFF_RENDERER.renderItem(IItemRenderer.ItemRenderType.ENTITY, wandFocusStack);
|
||||
} else {
|
||||
WAND_RENDERER.renderItem(IItemRenderer.ItemRenderType.ENTITY, wandFocusStack);
|
||||
RenderTileInfusionClaw.WAND_RENDERER.renderItem(IItemRenderer.ItemRenderType.ENTITY, wandFocusStack);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(0, (0.5f - (1f / 16f * 0.75f)), 0);
|
||||
GL11.glScalef(0.75f, 0.75f, 0.75f);
|
||||
|
||||
renderPart(4);
|
||||
this.renderPart(4);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
EntityPrimalOrb orb = new EntityPrimalOrb(tile.getWorldObj(), Minecraft.getMinecraft().thePlayer, true);
|
||||
orb.ticksExisted = Minecraft.getMinecraft().renderViewEntity.ticksExisted;
|
||||
|
||||
RENDER_PRIMAL_ORB.renderEntityAt(orb, 0, 0, 0, 0, 0);
|
||||
RenderTileInfusionClaw.RENDER_PRIMAL_ORB.renderEntityAt(orb, 0, 0, 0, 0, 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -202,8 +202,8 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
private void createSideZap(TileInfusionClaw tile) {
|
||||
for(int i = 2; i < 6; i++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
createZap(tile, 0.5f + 0.5f*(float)dir.offsetX, 0.6f, 0.5f + 0.5f*(float)dir.offsetZ, 0.5f + dir.offsetX*0.2f, 0.2f, 0.5f + dir.offsetZ*0.2f);
|
||||
playZapSound(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
this.createZap(tile, 0.5f + 0.5f*(float)dir.offsetX, 0.6f, 0.5f + 0.5f*(float)dir.offsetZ, 0.5f + dir.offsetX*0.2f, 0.2f, 0.5f + dir.offsetZ*0.2f);
|
||||
this.playZapSound(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
tile.animationStates[8] = -tile.animationStates[8];
|
||||
tile.animationStates[9] = 1;
|
||||
|
||||
createSideZap(tile);
|
||||
this.createSideZap(tile);
|
||||
}
|
||||
} else if (tile.animationStates[8] < 0) {
|
||||
tile.animationStates[8] += elapsed * 0.5;
|
||||
@@ -238,8 +238,8 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
float heightMove = getNextMoveOffset(tile, i, speed, elapsed);
|
||||
float widthMove = getNextMoveOffset(tile, i + 4, speed, elapsed);
|
||||
float heightMove = this.getNextMoveOffset(tile, i, speed, elapsed);
|
||||
float widthMove = this.getNextMoveOffset(tile, i + 4, speed, elapsed);
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i + 2);
|
||||
boolean powered = world != null && world.getIndirectPowerLevelTo(x + dir.offsetX, y, z + dir.offsetZ, dir.ordinal()) > 0;
|
||||
@@ -252,7 +252,7 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glScalef(0.75f, 0.75f, 0.75f);
|
||||
|
||||
renderRedstonePart(powered);
|
||||
this.renderRedstonePart(powered);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -260,15 +260,15 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
private float getNextMoveOffset(TileInfusionClaw tile, int id, float speed, float elapsed) {
|
||||
tile.animationStates[id] += RANDOM.nextDouble() * 2 * elapsed * speed;
|
||||
tile.animationStates[id] += RenderTileInfusionClaw.RANDOM.nextDouble() * 2 * elapsed * speed;
|
||||
return (float) ((1d / 16d) * Math.sin(tile.animationStates[id] / 30));
|
||||
}
|
||||
|
||||
private void renderRedstonePart(boolean powered) {
|
||||
renderPart(powered ? 6 : 5);
|
||||
this.renderPart(powered ? 6 : 5);
|
||||
}
|
||||
|
||||
private void renderPart(int num) {
|
||||
MODELS[num].render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f);
|
||||
RenderTileInfusionClaw.MODELS[num].render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class RenderTileKnowledgeBook extends TileEntitySpecialRenderer {
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks) {
|
||||
if(te == null || !(te instanceof TileKnowledgeBook)) return;
|
||||
|
||||
renderFloatingBook((TileKnowledgeBook) te, x, y, z, partialTicks);
|
||||
this.renderFloatingBook((TileKnowledgeBook) te, x, y, z, partialTicks);
|
||||
}
|
||||
|
||||
private void renderFloatingBook(TileKnowledgeBook te, double x, double y, double z, float partialTicks) {
|
||||
@@ -45,11 +45,11 @@ public class RenderTileKnowledgeBook extends TileEntitySpecialRenderer {
|
||||
float f3 = attributes.field_145925_p + f2 * partialTicks;
|
||||
GL11.glRotatef(-f3 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F);
|
||||
this.bindTexture(bookTexture);
|
||||
this.bindTexture(RenderTileKnowledgeBook.bookTexture);
|
||||
float f4 = attributes.field_145931_j + (attributes.field_145933_i - attributes.field_145931_j) * partialTicks + 0.25F;
|
||||
float f5 = attributes.field_145931_j + (attributes.field_145933_i - attributes.field_145931_j) * partialTicks + 0.75F;
|
||||
f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F;
|
||||
f5 = (f5 - (float)MathHelper.truncateDoubleToInt((double)f5)) * 1.6F - 0.3F;
|
||||
f4 = (f4 - (float)MathHelper.truncateDoubleToInt(f4)) * 1.6F - 0.3F;
|
||||
f5 = (f5 - (float)MathHelper.truncateDoubleToInt(f5)) * 1.6F - 0.3F;
|
||||
|
||||
if (f4 < 0.0F)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ public class RenderTileKnowledgeBook extends TileEntitySpecialRenderer {
|
||||
|
||||
//float f6 = attributes.field_145927_n + (attributes.field_145930_m - attributes.field_145927_n) * partialTicks; We don't want it to close..
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
modelBook.render(null, 45F, f4, f5, 0.9F, 0.0F, 0.0625F);
|
||||
RenderTileKnowledgeBook.modelBook.render(null, 45F, f4, f5, 0.9F, 0.0F, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
bindTexture(new SimpleResourceLocation("models/manipulation_focus_" + tile.getBlockMetadata() + ".png"));
|
||||
this.bindTexture(new SimpleResourceLocation("models/manipulation_focus_" + tile.getBlockMetadata() + ".png"));
|
||||
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
GL11.glTranslatef(0.5f, -1.5f + (2/16f), -0.5f);
|
||||
@@ -33,9 +33,9 @@ public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < 4; i++) {
|
||||
if(tile.getBlockMetadata() == 0) {
|
||||
RANDOM_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileManipulationFocus.RANDOM_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
} else {
|
||||
PORTAL_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileManipulationFocus.PORTAL_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
}
|
||||
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
@@ -48,6 +48,6 @@ public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
|
||||
renderTileEntityAt((TileManipulationFocus)tile, x, y, z, partialTicks);
|
||||
this.renderTileEntityAt((TileManipulationFocus)tile, x, y, z, partialTicks);
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -24,14 +24,14 @@ public class RenderTileManipulatorPillar extends TileInfusionPillarRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) {
|
||||
ResourceLocation originalTexture = BOUND_TEXTURES.get(TC_TEXTURE);
|
||||
BOUND_TEXTURES.put(TC_TEXTURE, TEXTURE);
|
||||
ResourceLocation originalTexture = RenderTileManipulatorPillar.BOUND_TEXTURES.get(RenderTileManipulatorPillar.TC_TEXTURE);
|
||||
RenderTileManipulatorPillar.BOUND_TEXTURES.put(RenderTileManipulatorPillar.TC_TEXTURE, RenderTileManipulatorPillar.TEXTURE);
|
||||
super.renderTileEntityAt(par1TileEntity, par2, par4, par6, par8);
|
||||
|
||||
if(originalTexture != null) {
|
||||
BOUND_TEXTURES.put(TC_TEXTURE, originalTexture);
|
||||
RenderTileManipulatorPillar.BOUND_TEXTURES.put(RenderTileManipulatorPillar.TC_TEXTURE, originalTexture);
|
||||
} else {
|
||||
BOUND_TEXTURES.remove(TC_TEXTURE);
|
||||
RenderTileManipulatorPillar.BOUND_TEXTURES.remove(RenderTileManipulatorPillar.TC_TEXTURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class RenderTileNodeBasic {
|
||||
public static void renderNode(EntityLivingBase viewer, double viewDistance, boolean visible, boolean depthIgnore, float size, double x, double y, double z, float partialTicks, AspectList aspects, NodeType type, NodeModifier mod) {
|
||||
long nt = System.nanoTime();
|
||||
|
||||
UtilsFX.bindTexture(nodetex);
|
||||
UtilsFX.bindTexture(RenderTileNodeBasic.nodetex);
|
||||
int frames = 32;
|
||||
if ((aspects.size() > 0) && (visible)) {
|
||||
double distance = viewer.getDistance(x, y, z); //Gadomancy: Removed '+ 0.5D' to coords.
|
||||
@@ -181,7 +181,7 @@ public class RenderTileNodeBasic {
|
||||
|
||||
//Gadomancy START
|
||||
public static void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
|
||||
renderTileEntityAt(tile, x, y, z, partialTicks, 1.0F);
|
||||
RenderTileNodeBasic.renderTileEntityAt(tile, x, y, z, partialTicks, 1.0F);
|
||||
}
|
||||
//Gadomancy END
|
||||
|
||||
@@ -217,7 +217,7 @@ public class RenderTileNodeBasic {
|
||||
}
|
||||
}
|
||||
//Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params
|
||||
renderNode(viewer, viewDistance, condition, depthIgnore, size, x, y, z, partialTicks, ((INode) tile).getAspects(), ((INode) tile).getNodeType(), ((INode) tile).getNodeModifier());
|
||||
RenderTileNodeBasic.renderNode(viewer, viewDistance, condition, depthIgnore, size, x, y, z, partialTicks, ((INode) tile).getAspects(), ((INode) tile).getNodeType(), ((INode) tile).getNodeModifier());
|
||||
if (((tile instanceof TileNode)) && (((TileNode) tile).drainEntity != null) && (((TileNode) tile).drainCollision != null)) {
|
||||
Entity drainEntity = ((TileNode) tile).drainEntity;
|
||||
if (((drainEntity instanceof EntityPlayer)) && (!((EntityPlayer) drainEntity).isUsingItem())) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class RenderTileNodeManipulator extends TileWandPedestalRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(r, g, b, a);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(RenderTileNodeManipulator.TEXTURE);
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
GL11.glPushMatrix();
|
||||
@@ -37,7 +37,7 @@ public class RenderTileNodeManipulator extends TileWandPedestalRenderer {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i + 2);
|
||||
GL11.glTranslatef(dir.offsetX * (-6/16f), 0, dir.offsetZ * (-6/16f));
|
||||
|
||||
MODEL.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
RenderTileNodeManipulator.MODEL.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ public class RenderTileRemoteJar extends TileJarRenderer {
|
||||
|
||||
renderer.func_147497_a(this.field_147501_a);
|
||||
|
||||
if(field_147501_a.field_147553_e != null) {
|
||||
renderer.renderTileEntityAt(createFakeTile(tile, BlockRemoteJar.getJarTile(tile).networkId != null), 0, 0, 0, partialTicks);
|
||||
if(this.field_147501_a.field_147553_e != null) {
|
||||
renderer.renderTileEntityAt(this.createFakeTile(tile, BlockRemoteJar.getJarTile(tile).networkId != null), 0, 0, 0, partialTicks);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -51,7 +51,7 @@ public class RenderTileRemoteJar extends TileJarRenderer {
|
||||
GL11.glTranslatef(0.5f, 0.002f, 0.5f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
|
||||
bindTexture(OVERLAY_TEXTURE);
|
||||
this.bindTexture(RenderTileRemoteJar.OVERLAY_TEXTURE);
|
||||
|
||||
GL11.glScalef(1.002f, 1f, 1.002f);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class RenderTileRemoteJar extends TileJarRenderer {
|
||||
GL11.glTranslatef(0, -1.5f, 0);
|
||||
//GL11.glRotatef(180, 1f, 0, 0);
|
||||
|
||||
MODEL_JAR_POT.render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f);
|
||||
RenderTileRemoteJar.MODEL_JAR_POT.render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RenderTileStickyJar extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslated(x, y, z);
|
||||
rotateJar(stickyJar.placedOn, ForgeDirection.getOrientation(stickyJar.facing));
|
||||
this.rotateJar(stickyJar.placedOn, ForgeDirection.getOrientation(stickyJar.facing));
|
||||
|
||||
//TESR
|
||||
TileEntitySpecialRenderer renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(parent);
|
||||
@@ -55,9 +55,9 @@ public class RenderTileStickyJar extends TileEntitySpecialRenderer {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
bindTexture(TextureMap.locationBlocksTexture);
|
||||
this.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
RENDER_BLOCKS.blockAccess = world;
|
||||
RenderTileStickyJar.RENDER_BLOCKS.blockAccess = world;
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
@@ -66,7 +66,7 @@ public class RenderTileStickyJar extends TileEntitySpecialRenderer {
|
||||
|
||||
tess.setTranslation(-tile.xCoord, -tile.yCoord, -tile.zCoord);
|
||||
|
||||
RENDER_BLOCKS.renderBlockByRenderType(block, tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
RenderTileStickyJar.RENDER_BLOCKS.renderBlockByRenderType(block, tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
|
||||
tess.setTranslation(0, 0, 0);
|
||||
tess.draw();
|
||||
|
||||
@@ -47,7 +47,7 @@ public class GolemGuiTexture extends BaseTexture {
|
||||
{
|
||||
IResource iresource = resourceManager.getResource(this.textureLocation);
|
||||
inputstream = iresource.getInputStream();
|
||||
BufferedImage bufferedimage = manipulateImage(resourceManager, ImageIO.read(inputstream));
|
||||
BufferedImage bufferedimage = this.manipulateImage(resourceManager, ImageIO.read(inputstream));
|
||||
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
@@ -66,7 +66,7 @@ public class GolemGuiTexture extends BaseTexture {
|
||||
}
|
||||
catch (RuntimeException runtimeexception)
|
||||
{
|
||||
LOGGER.warn("Failed reading metadata of: " + this.textureLocation, runtimeexception);
|
||||
GolemGuiTexture.LOGGER.warn("Failed reading metadata of: " + this.textureLocation, runtimeexception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class GolemGuiTexture extends BaseTexture {
|
||||
|
||||
List<AdditionalGolemType> types = GadomancyApi.getAdditionalGolemTypes();
|
||||
|
||||
int newHeight = (24*scale) * (getMaxOrdinal() + 1);
|
||||
int newHeight = (24*scale) * (this.getMaxOrdinal() + 1);
|
||||
BufferedImage newImg = new BufferedImage(image.getWidth(), newHeight < image.getHeight() ? image.getHeight() : newHeight, image.getType());
|
||||
|
||||
for(int x = 0; x < image.getWidth(); x++) {
|
||||
@@ -98,12 +98,12 @@ public class GolemGuiTexture extends BaseTexture {
|
||||
for(AdditionalGolemType type : types) {
|
||||
try {
|
||||
int ordinal = type.getEnumEntry().ordinal();
|
||||
BufferedImage slotImg = loadImage(resourceManager, type.getInvSlotTexture());
|
||||
BufferedImage slotImg = this.loadImage(resourceManager, type.getInvSlotTexture());
|
||||
|
||||
float slotScale = (24*scale) / (float)slotImg.getWidth();
|
||||
|
||||
if(slotScale > 1) {
|
||||
slotImg = scaleImage(slotImg, slotScale, slotScale);
|
||||
slotImg = this.scaleImage(slotImg, slotScale, slotScale);
|
||||
}
|
||||
|
||||
for(int x = 0; x < slotImg.getWidth(); x++) {
|
||||
@@ -112,7 +112,7 @@ public class GolemGuiTexture extends BaseTexture {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOGGER.warn("Failed loading golem inventory slot texture of: " + type.getModId() + ":" + type.getName());
|
||||
GolemGuiTexture.LOGGER.warn("Failed loading golem inventory slot texture of: " + type.getModId() + ":" + type.getName());
|
||||
}
|
||||
}
|
||||
return newImg;
|
||||
|
||||
@@ -34,68 +34,68 @@ public class FakeEntityGolemBase extends EntityGolemBase {
|
||||
//Golem stuff
|
||||
@Override
|
||||
public String getGolemDecoration() {
|
||||
return golem.getGolemDecoration();
|
||||
return this.golem.getGolemDecoration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumGolemType getGolemType() {
|
||||
return golem.getGolemType();
|
||||
return this.golem.getGolemType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getCore() {
|
||||
return golem.getCore();
|
||||
return this.golem.getCore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCarryLimit() {
|
||||
return golem.getCarryLimit();
|
||||
return this.golem.getCarryLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getUpgrade(int slot) {
|
||||
return golem.getUpgrade(slot);
|
||||
return this.golem.getUpgrade(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUpgradeAmount(int type) {
|
||||
return golem.getUpgradeAmount(type);
|
||||
return this.golem.getUpgradeAmount(type);
|
||||
}
|
||||
|
||||
//Player stuff
|
||||
@Override
|
||||
public float getEyeHeight() {
|
||||
return player.getEyeHeight();
|
||||
return this.player.getEyeHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCarriedForDisplay() {
|
||||
return player.getHeldItem();
|
||||
return this.player.getHeldItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getHeldItem() {
|
||||
return player.getHeldItem();
|
||||
return this.player.getHeldItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSneaking() {
|
||||
return player.isSneaking();
|
||||
return this.player.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEating() {
|
||||
return player.isEating();
|
||||
return this.player.isEating();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvisible() {
|
||||
return player.isInvisible();
|
||||
return this.player.isInvisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSprinting() {
|
||||
return player.isSprinting();
|
||||
return this.player.isSprinting();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,72 +104,72 @@ public class FakeEntityGolemBase extends EntityGolemBase {
|
||||
}
|
||||
|
||||
public void syncWithPlayer() {
|
||||
setWorld(player.worldObj);
|
||||
setPosition(player.posX, player.posY, player.posZ);
|
||||
this.setWorld(this.player.worldObj);
|
||||
this.setPosition(this.player.posX, this.player.posY, this.player.posZ);
|
||||
|
||||
lastTickPosX = player.lastTickPosX;
|
||||
lastTickPosY = player.lastTickPosY;
|
||||
lastTickPosZ = player.lastTickPosZ;
|
||||
this.lastTickPosX = this.player.lastTickPosX;
|
||||
this.lastTickPosY = this.player.lastTickPosY;
|
||||
this.lastTickPosZ = this.player.lastTickPosZ;
|
||||
|
||||
motionX = player.motionX;
|
||||
motionY = player.motionY;
|
||||
motionZ = player.motionZ;
|
||||
this.motionX = this.player.motionX;
|
||||
this.motionY = this.player.motionY;
|
||||
this.motionZ = this.player.motionZ;
|
||||
|
||||
moveForward = player.moveForward;
|
||||
moveStrafing = player.moveStrafing;
|
||||
this.moveForward = this.player.moveForward;
|
||||
this.moveStrafing = this.player.moveStrafing;
|
||||
|
||||
onGround = player.onGround;
|
||||
this.onGround = this.player.onGround;
|
||||
|
||||
prevPosX = player.prevPosX;
|
||||
prevPosY = player.prevPosY;
|
||||
prevPosZ = player.prevPosZ;
|
||||
this.prevPosX = this.player.prevPosX;
|
||||
this.prevPosY = this.player.prevPosY;
|
||||
this.prevPosZ = this.player.prevPosZ;
|
||||
|
||||
rotationPitch = player.rotationPitch;
|
||||
rotationYaw = player.rotationYaw;
|
||||
rotationYawHead = player.rotationYawHead;
|
||||
this.rotationPitch = this.player.rotationPitch;
|
||||
this.rotationYaw = this.player.rotationYaw;
|
||||
this.rotationYawHead = this.player.rotationYawHead;
|
||||
|
||||
prevRotationPitch = player.prevRotationPitch;
|
||||
prevRotationYaw = player.prevRotationYaw;
|
||||
prevRotationYawHead = player.prevRotationYawHead;
|
||||
this.prevRotationPitch = this.player.prevRotationPitch;
|
||||
this.prevRotationYaw = this.player.prevRotationYaw;
|
||||
this.prevRotationYawHead = this.player.prevRotationYawHead;
|
||||
|
||||
limbSwing = player.limbSwing;
|
||||
this.limbSwing = this.player.limbSwing;
|
||||
|
||||
limbSwingAmount = player.limbSwingAmount;
|
||||
prevLimbSwingAmount = player.prevLimbSwingAmount;
|
||||
isSwingInProgress = player.isSwingInProgress;
|
||||
this.limbSwingAmount = this.player.limbSwingAmount;
|
||||
this.prevLimbSwingAmount = this.player.prevLimbSwingAmount;
|
||||
this.isSwingInProgress = this.player.isSwingInProgress;
|
||||
|
||||
swingProgress = player.swingProgress;
|
||||
prevSwingProgress = player.prevSwingProgress;
|
||||
this.swingProgress = this.player.swingProgress;
|
||||
this.prevSwingProgress = this.player.prevSwingProgress;
|
||||
|
||||
renderYawOffset = player.renderYawOffset;
|
||||
prevRenderYawOffset = player.prevRenderYawOffset;
|
||||
this.renderYawOffset = this.player.renderYawOffset;
|
||||
this.prevRenderYawOffset = this.player.prevRenderYawOffset;
|
||||
|
||||
ticksExisted = player.ticksExisted;
|
||||
isDead = false;
|
||||
isAirBorne = player.isAirBorne;
|
||||
this.ticksExisted = this.player.ticksExisted;
|
||||
this.isDead = false;
|
||||
this.isAirBorne = this.player.isAirBorne;
|
||||
|
||||
yOffset = 0;
|
||||
this.yOffset = 0;
|
||||
|
||||
swingProgress = player.swingProgress;
|
||||
prevSwingProgress = player.prevSwingProgress;
|
||||
this.swingProgress = this.player.swingProgress;
|
||||
this.prevSwingProgress = this.player.prevSwingProgress;
|
||||
|
||||
limbSwing = player.limbSwing;
|
||||
limbSwingAmount = player.limbSwingAmount;
|
||||
prevLimbSwingAmount = player.limbSwingAmount;
|
||||
this.limbSwing = this.player.limbSwing;
|
||||
this.limbSwingAmount = this.player.limbSwingAmount;
|
||||
this.prevLimbSwingAmount = this.player.limbSwingAmount;
|
||||
|
||||
isSwingInProgress = player.isSwingInProgress;
|
||||
this.isSwingInProgress = this.player.isSwingInProgress;
|
||||
|
||||
itemCarried = player.getHeldItem();
|
||||
this.itemCarried = this.player.getHeldItem();
|
||||
|
||||
if(player.isSwingInProgress) {
|
||||
if(player.getHeldItem() == null) {
|
||||
action = 6 - player.swingProgressInt;
|
||||
if(this.player.isSwingInProgress) {
|
||||
if(this.player.getHeldItem() == null) {
|
||||
this.action = 6 - this.player.swingProgressInt;
|
||||
} else {
|
||||
rightArm = 5 - (int)(player.swingProgress * 5);
|
||||
this.rightArm = 5 - (int)(this.player.swingProgress * 5);
|
||||
}
|
||||
} else {
|
||||
action = 0;
|
||||
rightArm = 0;
|
||||
this.action = 0;
|
||||
this.rightArm = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class TransformationHelper {
|
||||
DEFAULT_GOLEM = new FakeEntityGolemBase(golem, null);
|
||||
}
|
||||
|
||||
private static PlayerCameraRenderer renderer = null;
|
||||
private static PlayerCameraRenderer renderer;
|
||||
|
||||
private static Map<Integer, Integer> transformedPlayers = new HashMap<Integer, Integer>();
|
||||
|
||||
@@ -50,7 +50,7 @@ public class TransformationHelper {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
return mc.thePlayer.equals(mc.renderViewEntity) && !RegisteredIntegrations.morph.isMorphed()
|
||||
&& mc.entityRenderer.getClass().equals(EntityRenderer.class)
|
||||
&& (renderer == null || renderer.isRemoved());
|
||||
&& (TransformationHelper.renderer == null || TransformationHelper.renderer.isRemoved());
|
||||
}
|
||||
|
||||
public static boolean isForeignTransformed() {
|
||||
@@ -62,24 +62,24 @@ public class TransformationHelper {
|
||||
}
|
||||
|
||||
public static boolean isTransformed() {
|
||||
return renderer != null && !renderer.isMarkedForRemoval();
|
||||
return TransformationHelper.renderer != null && !TransformationHelper.renderer.isMarkedForRemoval();
|
||||
}
|
||||
|
||||
public static boolean isTransformed(EntityPlayer player) {
|
||||
if(player.equals(Minecraft.getMinecraft().thePlayer))
|
||||
return isTransformed();
|
||||
return getTransformedEntityId(player) != -1;
|
||||
return TransformationHelper.isTransformed();
|
||||
return TransformationHelper.getTransformedEntityId(player) != -1;
|
||||
}
|
||||
|
||||
public static FakeEntityGolemBase getTransformedEntity(EntityPlayer player) {
|
||||
Integer entityId = transformedPlayers.get(player.getEntityId());
|
||||
Integer entityId = TransformationHelper.transformedPlayers.get(player.getEntityId());
|
||||
if(entityId != null) {
|
||||
FakeEntityGolemBase golem = entityCache.get(entityId);
|
||||
FakeEntityGolemBase golem = TransformationHelper.entityCache.get(entityId);
|
||||
if(golem == null) {
|
||||
EntityGolemBase rawGolem = findGolem(entityId);
|
||||
EntityGolemBase rawGolem = TransformationHelper.findGolem(entityId);
|
||||
if(rawGolem != null) {
|
||||
golem = new FakeEntityGolemBase(rawGolem, player);
|
||||
entityCache.put(entityId, golem);
|
||||
TransformationHelper.entityCache.put(entityId, golem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class TransformationHelper {
|
||||
return golem;
|
||||
}
|
||||
}
|
||||
return DEFAULT_GOLEM;
|
||||
return TransformationHelper.DEFAULT_GOLEM;
|
||||
}
|
||||
|
||||
private static EntityGolemBase findGolem(int entityId) {
|
||||
@@ -102,47 +102,47 @@ public class TransformationHelper {
|
||||
}
|
||||
|
||||
public static FakeEntityGolemBase getTransformedEntity() {
|
||||
return getTransformedEntity(Minecraft.getMinecraft().thePlayer);
|
||||
return TransformationHelper.getTransformedEntity(Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
|
||||
private static int getTransformedEntityId(EntityPlayer player) {
|
||||
Integer entityId = transformedPlayers.get(player.getEntityId());
|
||||
Integer entityId = TransformationHelper.transformedPlayers.get(player.getEntityId());
|
||||
return entityId == null ? -1 : entityId;
|
||||
}
|
||||
|
||||
public static int getTransformedEntityId() {
|
||||
return getTransformedEntityId(Minecraft.getMinecraft().thePlayer);
|
||||
return TransformationHelper.getTransformedEntityId(Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
|
||||
public static void cancelTransformation(PacketAbortTransform.AbortReason reason) {
|
||||
if(isTransformed()) {
|
||||
if(TransformationHelper.isTransformed()) {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketAbortTransform(reason));
|
||||
onAbortTransformation(Minecraft.getMinecraft().thePlayer.getEntityId());
|
||||
TransformationHelper.onAbortTransformation(Minecraft.getMinecraft().thePlayer.getEntityId());
|
||||
}
|
||||
}
|
||||
|
||||
public static void onStartTransformation(int targetId, int appearanceId) {
|
||||
if(Minecraft.getMinecraft().thePlayer.getEntityId() == targetId) {
|
||||
if(isTransformable()) {
|
||||
transformedPlayers.put(targetId, appearanceId);
|
||||
if(TransformationHelper.isTransformable()) {
|
||||
TransformationHelper.transformedPlayers.put(targetId, appearanceId);
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
renderer = new PlayerCameraRenderer(mc, mc.entityRenderer);
|
||||
mc.entityRenderer = renderer;
|
||||
TransformationHelper.renderer = new PlayerCameraRenderer(mc, mc.entityRenderer);
|
||||
mc.entityRenderer = TransformationHelper.renderer;
|
||||
} else {
|
||||
cancelTransformation(PacketAbortTransform.AbortReason.TRANSFORMATION_FAILED);
|
||||
TransformationHelper.cancelTransformation(PacketAbortTransform.AbortReason.TRANSFORMATION_FAILED);
|
||||
}
|
||||
} else {
|
||||
transformedPlayers.put(targetId, appearanceId);
|
||||
TransformationHelper.transformedPlayers.put(targetId, appearanceId);
|
||||
}
|
||||
}
|
||||
|
||||
public static void onAbortTransformation(int targetId) {
|
||||
transformedPlayers.remove(targetId);
|
||||
entityCache.remove(targetId);
|
||||
TransformationHelper.transformedPlayers.remove(targetId);
|
||||
TransformationHelper.entityCache.remove(targetId);
|
||||
|
||||
if(Minecraft.getMinecraft().thePlayer.getEntityId() == targetId && isTransformed()) {
|
||||
renderer.markForRemoval();
|
||||
if(Minecraft.getMinecraft().thePlayer.getEntityId() == targetId && TransformationHelper.isTransformed()) {
|
||||
TransformationHelper.renderer.markForRemoval();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,48 +16,48 @@ import thaumcraft.api.nodes.NodeType;
|
||||
public class ExtendedTypeDisplayManager {
|
||||
|
||||
private static int timeout = 7;
|
||||
private static int currTime = 0;
|
||||
private static int currTime;
|
||||
|
||||
private static boolean changedLanguageFile = false;
|
||||
private static String currentNodeId = null;
|
||||
private static String changedEntry = null;
|
||||
private static String oldName = null;
|
||||
private static boolean changedLanguageFile;
|
||||
private static String currentNodeId;
|
||||
private static String changedEntry;
|
||||
private static String oldName;
|
||||
|
||||
public static void notifyRenderTick() {
|
||||
if(currTime > timeout) {
|
||||
if(changedLanguageFile) {
|
||||
resetLanguageFile();
|
||||
if(ExtendedTypeDisplayManager.currTime > ExtendedTypeDisplayManager.timeout) {
|
||||
if(ExtendedTypeDisplayManager.changedLanguageFile) {
|
||||
ExtendedTypeDisplayManager.resetLanguageFile();
|
||||
}
|
||||
} else {
|
||||
currTime++;
|
||||
ExtendedTypeDisplayManager.currTime++;
|
||||
}
|
||||
}
|
||||
|
||||
private static void resetLanguageFile() {
|
||||
currentNodeId = null;
|
||||
ResourceReloadListener.languageList.put(changedEntry, oldName);
|
||||
changedLanguageFile = false;
|
||||
ExtendedTypeDisplayManager.currentNodeId = null;
|
||||
ResourceReloadListener.languageList.put(ExtendedTypeDisplayManager.changedEntry, ExtendedTypeDisplayManager.oldName);
|
||||
ExtendedTypeDisplayManager.changedLanguageFile = false;
|
||||
}
|
||||
|
||||
public static void notifyDisplayTick(String id, NodeType nodeType, ExtendedNodeType extendedNodeType) {
|
||||
currTime = 0;
|
||||
ExtendedTypeDisplayManager.currTime = 0;
|
||||
|
||||
if(currentNodeId != null && !currentNodeId.equals(id)) {
|
||||
if(ExtendedTypeDisplayManager.currentNodeId != null && !ExtendedTypeDisplayManager.currentNodeId.equals(id)) {
|
||||
//New node.
|
||||
resetLanguageFile();
|
||||
ExtendedTypeDisplayManager.resetLanguageFile();
|
||||
}
|
||||
|
||||
if(!changedLanguageFile) {
|
||||
if(!ExtendedTypeDisplayManager.changedLanguageFile) {
|
||||
String toChance = "nodetype." + nodeType + ".name";
|
||||
String name = StatCollector.translateToLocal(toChance);
|
||||
String growingStr = StatCollector.translateToLocal("gadomancy.nodes." + extendedNodeType.name());
|
||||
String newName = name + ", " + growingStr;
|
||||
ResourceReloadListener.languageList.put(toChance, newName);
|
||||
|
||||
oldName = name;
|
||||
changedEntry = toChance;
|
||||
changedLanguageFile = true;
|
||||
currentNodeId = id;
|
||||
ExtendedTypeDisplayManager.oldName = name;
|
||||
ExtendedTypeDisplayManager.changedEntry = toChance;
|
||||
ExtendedTypeDisplayManager.changedLanguageFile = true;
|
||||
ExtendedTypeDisplayManager.currentNodeId = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class FamiliarHandlerClient {
|
||||
|
||||
private static EntityWisp ENTITY_WISP = null;
|
||||
private static EntityWisp ENTITY_WISP;
|
||||
|
||||
private static RenderWisp fallbackRenderer;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FamiliarHandlerClient {
|
||||
public static void processBoltPacket(PacketFamiliarBolt pkt) {
|
||||
EntityPlayer p = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(pkt.owner);
|
||||
if(p == null || p.getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer) > 1024) return; //32^2
|
||||
ExFamiliarData data = clientFamiliars.get(p.getCommandSenderName());
|
||||
ExFamiliarData data = FamiliarHandlerClient.clientFamiliars.get(p.getCommandSenderName());
|
||||
if(data == null) return;
|
||||
PartialEntityFamiliar fam = data.familiar;
|
||||
float y = (float) (fam.posY + 1.22F);
|
||||
@@ -60,16 +60,16 @@ public class FamiliarHandlerClient {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void playerRenderEvent(EntityPlayer player, float partialTicks) {
|
||||
String ownerName = player.getCommandSenderName();
|
||||
if(!clientFamiliars.containsKey(ownerName)) return;
|
||||
if(!FamiliarHandlerClient.clientFamiliars.containsKey(ownerName)) return;
|
||||
|
||||
ExFamiliarData data = clientFamiliars.get(ownerName);
|
||||
ExFamiliarData data = FamiliarHandlerClient.clientFamiliars.get(ownerName);
|
||||
PartialEntityFamiliar fam = data.familiar;
|
||||
|
||||
Aspect aspect = Aspect.getAspect(data.data.aspectTag);
|
||||
|
||||
if(ENTITY_WISP == null) ENTITY_WISP = new EntityWisp(new FakeWorld());
|
||||
ENTITY_WISP.setType(aspect.getTag());
|
||||
ENTITY_WISP.ticksExisted = fam.dummyEntity.ticksExisted;
|
||||
if(FamiliarHandlerClient.ENTITY_WISP == null) FamiliarHandlerClient.ENTITY_WISP = new EntityWisp(new FakeWorld());
|
||||
FamiliarHandlerClient.ENTITY_WISP.setType(aspect.getTag());
|
||||
FamiliarHandlerClient.ENTITY_WISP.ticksExisted = fam.dummyEntity.ticksExisted;
|
||||
GL11.glPushMatrix();
|
||||
if(fam.owner == null || fam.owner.get() == null) {
|
||||
fam.owner = new WeakReference<EntityPlayer>(player);
|
||||
@@ -91,35 +91,35 @@ public class FamiliarHandlerClient {
|
||||
diffZ -= ((entity.posZ - entity.lastTickPosZ) * partialTicks);
|
||||
}
|
||||
|
||||
ItemRenderFamiliar.renderEntityWispFor(fam.owner.get(), ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks);
|
||||
ItemRenderFamiliar.renderEntityWispFor(fam.owner.get(), FamiliarHandlerClient.ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void playerTickEvent() {
|
||||
if(Minecraft.getMinecraft().theWorld == null) return;
|
||||
for(ExFamiliarData data : clientFamiliars.values()) {
|
||||
for(ExFamiliarData data : FamiliarHandlerClient.clientFamiliars.values()) {
|
||||
data.familiar.tick();
|
||||
}
|
||||
PartialEntityFamiliar.DUMMY_FAMILIAR.tick();
|
||||
}
|
||||
|
||||
static {
|
||||
fallbackRenderer = new RenderWisp();
|
||||
fallbackRenderer.setRenderManager(RenderManager.instance);
|
||||
FamiliarHandlerClient.fallbackRenderer = new RenderWisp();
|
||||
FamiliarHandlerClient.fallbackRenderer.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
public static void handleAdditions(List<DataFamiliar.FamiliarData> toAdd) {
|
||||
for(DataFamiliar.FamiliarData data : toAdd) {
|
||||
PartialEntityFamiliar familiar = new PartialEntityFamiliar(Minecraft.getMinecraft().theWorld.getPlayerEntityByName(data.owner), data.owner);
|
||||
ExFamiliarData exData = new ExFamiliarData(data, familiar);
|
||||
clientFamiliars.put(data.owner, exData);
|
||||
FamiliarHandlerClient.clientFamiliars.put(data.owner, exData);
|
||||
}
|
||||
}
|
||||
|
||||
public static void handleRemovals(List<DataFamiliar.FamiliarData> toRemove) {
|
||||
for(DataFamiliar.FamiliarData data : toRemove) {
|
||||
clientFamiliars.remove(data.owner);
|
||||
FamiliarHandlerClient.clientFamiliars.remove(data.owner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,18 +136,18 @@ public class FamiliarHandlerClient {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null || this.getClass() != o.getClass()) return false;
|
||||
|
||||
ExFamiliarData that = (ExFamiliarData) o;
|
||||
|
||||
return !(data != null ? !data.equals(that.data) : that.data != null) && !(familiar != null ? !familiar.equals(that.familiar) : that.familiar != null);
|
||||
return (this.data != null ? this.data.equals(that.data) : that.data == null) && (this.familiar != null ? this.familiar.equals(that.familiar) : that.familiar == null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = data != null ? data.hashCode() : 0;
|
||||
result = 31 * result + (familiar != null ? familiar.hashCode() : 0);
|
||||
int result = this.data != null ? this.data.hashCode() : 0;
|
||||
result = 31 * result + (this.familiar != null ? this.familiar.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ public class FamiliarHandlerClient {
|
||||
public double posX, posY, posZ;
|
||||
public double renderX, renderY, renderZ;
|
||||
public double prevPosX, prevPosY, prevPosZ;
|
||||
public int ticksExisted = 0;
|
||||
public int ticksExisted;
|
||||
|
||||
public PartialEntityFamiliar(EntityPlayer owner, String ownerNameToSearch) {
|
||||
this.owner = new WeakReference<EntityPlayer>(owner);
|
||||
@@ -190,14 +190,14 @@ public class FamiliarHandlerClient {
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
ticksExisted++;
|
||||
dummyEntity.ticksExisted = ticksExisted;
|
||||
this.ticksExisted++;
|
||||
this.dummyEntity.ticksExisted = this.ticksExisted;
|
||||
|
||||
if(owner.get() == null) {
|
||||
if(potentialOwnerName != null) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(potentialOwnerName);
|
||||
if(this.owner.get() == null) {
|
||||
if(this.potentialOwnerName != null) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(this.potentialOwnerName);
|
||||
if(player != null) {
|
||||
owner = new WeakReference<EntityPlayer>(player);
|
||||
this.owner = new WeakReference<EntityPlayer>(player);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@@ -205,8 +205,8 @@ public class FamiliarHandlerClient {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(owner.get().worldObj.provider.dimensionId != Minecraft.getMinecraft().renderViewEntity.worldObj.provider.dimensionId) {
|
||||
owner = new WeakReference<EntityPlayer>(null);
|
||||
if(this.owner.get().worldObj.provider.dimensionId != Minecraft.getMinecraft().renderViewEntity.worldObj.provider.dimensionId) {
|
||||
this.owner = new WeakReference<EntityPlayer>(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -215,15 +215,15 @@ public class FamiliarHandlerClient {
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
double part = ((double) ticksExisted) / ((double) CRICLE_TIME_TICKS);
|
||||
double theta = RAD_CAP * part;
|
||||
this.renderX = RADIUS * Math.cos(theta);
|
||||
this.renderZ = RADIUS * Math.sin(theta);
|
||||
double part = ((double) this.ticksExisted) / ((double) PartialEntityFamiliar.CRICLE_TIME_TICKS);
|
||||
double theta = PartialEntityFamiliar.RAD_CAP * part;
|
||||
this.renderX = PartialEntityFamiliar.RADIUS * Math.cos(theta);
|
||||
this.renderZ = PartialEntityFamiliar.RADIUS * Math.sin(theta);
|
||||
this.renderY = Math.sin(theta * 2) / 2D;
|
||||
|
||||
this.posX = owner.get().posX + renderX;
|
||||
this.posZ = owner.get().posZ + renderZ;
|
||||
this.posY = owner.get().posY + renderY;
|
||||
this.posX = this.owner.get().posX + this.renderX;
|
||||
this.posZ = this.owner.get().posZ + this.renderZ;
|
||||
this.posY = this.owner.get().posY + this.renderY;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,18 +30,18 @@ public class MultiTickEffectDispatcher {
|
||||
private static List<BubbleFXInfo> bubbleInfos = new ArrayList<BubbleFXInfo>();
|
||||
|
||||
public static void notifyRenderTick(World currentRenderWorld, float partialTicks) {
|
||||
renderLock.lock();
|
||||
MultiTickEffectDispatcher.renderLock.lock();
|
||||
try {
|
||||
handleVortexDiggingEffects(currentRenderWorld);
|
||||
handleWispyLineEffects(currentRenderWorld, partialTicks);
|
||||
handleBubbleSpawnings(currentRenderWorld);
|
||||
MultiTickEffectDispatcher.handleVortexDiggingEffects(currentRenderWorld);
|
||||
MultiTickEffectDispatcher.handleWispyLineEffects(currentRenderWorld, partialTicks);
|
||||
MultiTickEffectDispatcher.handleBubbleSpawnings(currentRenderWorld);
|
||||
} finally {
|
||||
renderLock.unlock();
|
||||
MultiTickEffectDispatcher.renderLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private static void handleBubbleSpawnings(World world) {
|
||||
Iterator<BubbleFXInfo> it = bubbleInfos.iterator();
|
||||
Iterator<BubbleFXInfo> it = MultiTickEffectDispatcher.bubbleInfos.iterator();
|
||||
while(it.hasNext()) {
|
||||
BubbleFXInfo info = it.next();
|
||||
if(info.dimId != world.provider.dimensionId) {
|
||||
@@ -68,7 +68,7 @@ public class MultiTickEffectDispatcher {
|
||||
|
||||
private static void handleWispyLineEffects(World currentRenderWorld, float partialTicks) {
|
||||
Tessellator tessellator;
|
||||
Iterator<FloatyLineInfo> it = floatyLineInfos.iterator();
|
||||
Iterator<FloatyLineInfo> it = MultiTickEffectDispatcher.floatyLineInfos.iterator();
|
||||
while(it.hasNext()) {
|
||||
FloatyLineInfo info = it.next();
|
||||
if(info.dimId != currentRenderWorld.provider.dimensionId) {
|
||||
@@ -91,7 +91,7 @@ public class MultiTickEffectDispatcher {
|
||||
}
|
||||
|
||||
private static void handleVortexDiggingEffects(World currentRenderWorld) {
|
||||
Iterator<VortexDigInfo> it = vortexDigInfos.iterator();
|
||||
Iterator<VortexDigInfo> it = MultiTickEffectDispatcher.vortexDigInfos.iterator();
|
||||
while(it.hasNext()) {
|
||||
VortexDigInfo info = it.next();
|
||||
if(info.dimId != currentRenderWorld.provider.dimensionId) {
|
||||
@@ -109,29 +109,29 @@ public class MultiTickEffectDispatcher {
|
||||
}
|
||||
|
||||
public static void registerBubbles(BubbleFXInfo info) {
|
||||
renderLock.lock();
|
||||
MultiTickEffectDispatcher.renderLock.lock();
|
||||
try {
|
||||
bubbleInfos.add(info);
|
||||
MultiTickEffectDispatcher.bubbleInfos.add(info);
|
||||
} finally {
|
||||
renderLock.unlock();
|
||||
MultiTickEffectDispatcher.renderLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerVortexDig(VortexDigInfo info) {
|
||||
renderLock.lock();
|
||||
MultiTickEffectDispatcher.renderLock.lock();
|
||||
try {
|
||||
vortexDigInfos.add(info);
|
||||
MultiTickEffectDispatcher.vortexDigInfos.add(info);
|
||||
} finally {
|
||||
renderLock.unlock();
|
||||
MultiTickEffectDispatcher.renderLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerFloatyLine(FloatyLineInfo info) {
|
||||
renderLock.lock();
|
||||
MultiTickEffectDispatcher.renderLock.lock();
|
||||
try {
|
||||
floatyLineInfos.add(info);
|
||||
MultiTickEffectDispatcher.floatyLineInfos.add(info);
|
||||
} finally {
|
||||
renderLock.unlock();
|
||||
MultiTickEffectDispatcher.renderLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class MultiTickEffectDispatcher {
|
||||
private int dimId;
|
||||
private double pedestalX, pedestalY, pedestalZ;
|
||||
private double originX, originY, originZ;
|
||||
private int renderTicks = 0;
|
||||
private int renderTicks;
|
||||
private int tickCap;
|
||||
private int colorAsInt;
|
||||
private int randomOffset = -1;
|
||||
@@ -182,7 +182,7 @@ public class MultiTickEffectDispatcher {
|
||||
private int tX, tY, tZ;
|
||||
private Block blockInstance;
|
||||
private int meta;
|
||||
private int renderTicks = 0;
|
||||
private int renderTicks;
|
||||
private int tickCap;
|
||||
|
||||
public VortexDigInfo(int dimId, int oX, int oY, int oZ, int tX, int tY, int tZ, Block blockInstance, int meta, int tickDuration) {
|
||||
|
||||
@@ -20,17 +20,17 @@ import java.util.Random;
|
||||
*/
|
||||
public class UtilsFX {
|
||||
|
||||
private static final Color[] RUNE_COLORS_RED = new Color[] { new Color(0xB60707), new Color(0xEE3782), new Color(0xF37B20), new Color(0xFF6722), new Color(0xFF6D30), new Color(0xFF0000) };
|
||||
private static final Color[] RUNE_COLORS_GREEN = new Color[] { new Color(0x015629), new Color(0x0E9C00), new Color(0x010000), new Color(0x01FF00), new Color(0x014C3E)};
|
||||
private static final Color[] RUNE_COLORS_BLUE = new Color[] { new Color(0x060956), new Color(0x012578), new Color(0x0C1556), new Color(0x0100FF), new Color(0x01018C)};
|
||||
private static final Color[] RUNE_COLORS_RED = { new Color(0xB60707), new Color(0xEE3782), new Color(0xF37B20), new Color(0xFF6722), new Color(0xFF6D30), new Color(0xFF0000) };
|
||||
private static final Color[] RUNE_COLORS_GREEN = { new Color(0x015629), new Color(0x0E9C00), new Color(0x010000), new Color(0x01FF00), new Color(0x014C3E)};
|
||||
private static final Color[] RUNE_COLORS_BLUE = { new Color(0x060956), new Color(0x012578), new Color(0x0C1556), new Color(0x0100FF), new Color(0x01018C)};
|
||||
|
||||
public static void doRuneEffects(World world, int x, int y, int z, int colorFlag) {
|
||||
if(world.isRemote) {
|
||||
int cnt = 20;
|
||||
while(cnt > 0) {
|
||||
cnt--;
|
||||
Color rand = evaluateRandomColor(world.rand, colorFlag);
|
||||
Thaumcraft.proxy.blockRunes(world, x + randomOffset(world), y + randomOffset(world), z + randomOffset(world),
|
||||
Color rand = UtilsFX.evaluateRandomColor(world.rand, colorFlag);
|
||||
Thaumcraft.proxy.blockRunes(world, x + UtilsFX.randomOffset(world), y + UtilsFX.randomOffset(world), z + UtilsFX.randomOffset(world),
|
||||
rand.getRed() / 255F, rand.getGreen() / 255F, rand.getBlue() / 255F, world.rand.nextInt(10) + 30, -0.01F - (world.rand.nextBoolean() ? world.rand.nextBoolean() ? 0.02F : 0.01F : 0F));
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,9 @@ public class UtilsFX {
|
||||
private static Color evaluateRandomColor(Random rand, int colorFlag) {
|
||||
Color[] possibleColors;
|
||||
if(colorFlag == 1) {
|
||||
possibleColors = RUNE_COLORS_BLUE;
|
||||
possibleColors = UtilsFX.RUNE_COLORS_BLUE;
|
||||
} else {
|
||||
possibleColors = RUNE_COLORS_RED;
|
||||
possibleColors = UtilsFX.RUNE_COLORS_RED;
|
||||
}
|
||||
return possibleColors[rand.nextInt(possibleColors.length)];
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class UtilsFX {
|
||||
|
||||
public static void doSparkleEffectsAround(World world, int x, int y, int z) {
|
||||
for(ChunkCoordinates cc : MiscUtils.getCoordinatesAround(new ChunkCoordinates(x, y, z))) {
|
||||
doSparkleEffects(world, cc.posX, cc.posY, cc.posZ);
|
||||
UtilsFX.doSparkleEffects(world, cc.posX, cc.posY, cc.posZ);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,14 +64,14 @@ public class UtilsFX {
|
||||
int count = world.rand.nextInt(6) + 2;
|
||||
for (int i = 0; i < count; i++) {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(
|
||||
new EntitySmokeFX(world, x + 0.5 + randEffectOffset(world.rand), y + 0.5 + randEffectOffset(world.rand), z + 0.5 + randEffectOffset(world.rand),
|
||||
randEffectOffset(world.rand) * 0.01F, randEffectOffset(world.rand) * 0.1F, randEffectOffset(world.rand) * 0.01F, size));
|
||||
new EntitySmokeFX(world, x + 0.5 + UtilsFX.randEffectOffset(world.rand), y + 0.5 + UtilsFX.randEffectOffset(world.rand), z + 0.5 + UtilsFX.randEffectOffset(world.rand),
|
||||
UtilsFX.randEffectOffset(world.rand) * 0.01F, UtilsFX.randEffectOffset(world.rand) * 0.1F, UtilsFX.randEffectOffset(world.rand) * 0.01F, size));
|
||||
}
|
||||
}
|
||||
|
||||
public static void doSmokeEffectsAround(World world, int x, int y, int z, float size) {
|
||||
for(ChunkCoordinates cc : MiscUtils.getCoordinatesAround(new ChunkCoordinates(x, y, z))) {
|
||||
doSmokeEffects(world, cc.posX, cc.posY, cc.posZ, size);
|
||||
UtilsFX.doSmokeEffects(world, cc.posX, cc.posY, cc.posZ, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import makeo.gadomancy.common.utils.Injector;
|
||||
import makeo.gadomancy.common.utils.world.WorldProviderTCEldrich;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
@@ -44,7 +43,7 @@ import java.util.List;
|
||||
*/
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
|
||||
public static boolean serverOnlineState = false;
|
||||
public static boolean serverOnlineState;
|
||||
|
||||
public static final EventHandlerGolem EVENT_HANDLER_GOLEM = new EventHandlerGolem();
|
||||
|
||||
@@ -65,7 +64,7 @@ public class CommonProxy implements IGuiHandler {
|
||||
public void initalize() {
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(Gadomancy.instance, this);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(EVENT_HANDLER_GOLEM);
|
||||
MinecraftForge.EVENT_BUS.register(CommonProxy.EVENT_HANDLER_GOLEM);
|
||||
FMLCommonHandler.instance().bus().register(new EventHandlerNetwork());
|
||||
EventHandlerWorld worldEventHandler = new EventHandlerWorld();
|
||||
MinecraftForge.EVENT_BUS.register(worldEventHandler);
|
||||
|
||||
@@ -2,11 +2,7 @@ package makeo.gadomancy.common;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLConstructionEvent;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import makeo.gadomancy.api.GadomancyApi;
|
||||
import makeo.gadomancy.common.api.DefaultApiHandler;
|
||||
import makeo.gadomancy.common.data.config.ModConfig;
|
||||
@@ -33,53 +29,53 @@ public class Gadomancy {
|
||||
private static final String PROXY_CLIENT = "makeo.gadomancy.client.ClientProxy";
|
||||
private static final String PROXY_SERVER = "makeo.gadomancy.common.CommonProxy";
|
||||
|
||||
@Mod.Instance(value = Gadomancy.MODID)
|
||||
@Mod.Instance(Gadomancy.MODID)
|
||||
public static Gadomancy instance;
|
||||
|
||||
@SidedProxy(clientSide = PROXY_CLIENT, serverSide = PROXY_SERVER)
|
||||
@SidedProxy(clientSide = Gadomancy.PROXY_CLIENT, serverSide = Gadomancy.PROXY_SERVER)
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public static Logger log = LogManager.getLogger("Gadomancy");
|
||||
private static ModData modData = null;
|
||||
private static ModData modData;
|
||||
|
||||
public static ModData getModData() {
|
||||
return modData;
|
||||
return Gadomancy.modData;
|
||||
}
|
||||
|
||||
public static void loadModData() {
|
||||
modData = new ModData("data");
|
||||
modData.load();
|
||||
Gadomancy.modData = new ModData("data");
|
||||
Gadomancy.modData.load();
|
||||
}
|
||||
|
||||
public static void unloadModData() {
|
||||
if(modData != null) {
|
||||
modData.save();
|
||||
modData = null;
|
||||
if(Gadomancy.modData != null) {
|
||||
Gadomancy.modData.save();
|
||||
Gadomancy.modData = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onConstruct(FMLConstructionEvent event) {
|
||||
GadomancyApi.setInstance(new DefaultApiHandler());
|
||||
proxy.onConstruct();
|
||||
Gadomancy.proxy.onConstruct();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
event.getModMetadata().version = VERSION;
|
||||
event.getModMetadata().version = Gadomancy.VERSION;
|
||||
ModConfig.init(event.getSuggestedConfigurationFile());
|
||||
proxy.preInitalize();
|
||||
Gadomancy.proxy.preInitalize();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
proxy.initalize();
|
||||
Gadomancy.proxy.initalize();
|
||||
|
||||
FMLInterModComms.sendMessage(Thaumcraft.MODID, "dimensionBlacklist", ModConfig.dimOuterId + ":0");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
proxy.postInitalize();
|
||||
Gadomancy.proxy.postInitalize();
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ import makeo.gadomancy.api.golems.AdditionalGolemType;
|
||||
import makeo.gadomancy.api.golems.cores.AdditionalGolemCore;
|
||||
import makeo.gadomancy.api.internal.IApiHandler;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.aura.AuraEffectHandler;
|
||||
import makeo.gadomancy.common.data.config.ModConfig;
|
||||
import makeo.gadomancy.common.entities.golems.ItemAdditionalGolemPlacer;
|
||||
import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.aura.AuraEffectHandler;
|
||||
import makeo.gadomancy.common.utils.GolemEnumHelper;
|
||||
import makeo.gadomancy.common.utils.NBTHelper;
|
||||
import makeo.gadomancy.common.utils.StringHelper;
|
||||
@@ -44,7 +44,7 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
@Override
|
||||
public boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType) {
|
||||
String uniqueName = name.toUpperCase();
|
||||
if(!additionalGolemTypes.containsKey(uniqueName)) {
|
||||
if(!DefaultApiHandler.additionalGolemTypes.containsKey(uniqueName)) {
|
||||
GolemEnumHelper.addGolemType(uniqueName, newType);
|
||||
|
||||
ItemAdditionalGolemPlacer placerItem = new ItemAdditionalGolemPlacer(newType);
|
||||
@@ -52,7 +52,7 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
newType.setModId(modId);
|
||||
newType.setPlacerItem(placerItem);
|
||||
|
||||
additionalGolemTypes.put(uniqueName, newType);
|
||||
DefaultApiHandler.additionalGolemTypes.put(uniqueName, newType);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -60,12 +60,12 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
|
||||
@Override
|
||||
public AdditionalGolemType getAdditionalGolemType(String name) {
|
||||
return additionalGolemTypes.get(name.toUpperCase());
|
||||
return DefaultApiHandler.additionalGolemTypes.get(name.toUpperCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdditionalGolemType> getAdditionalGolemTypes() {
|
||||
return new ArrayList<AdditionalGolemType>(additionalGolemTypes.values());
|
||||
return new ArrayList<AdditionalGolemType>(DefaultApiHandler.additionalGolemTypes.values());
|
||||
}
|
||||
|
||||
private static Map<String, AdditionalGolemCore> additionalGolemCores = new HashMap<String, AdditionalGolemCore>();
|
||||
@@ -74,7 +74,7 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
public AdditionalGolemCore getAdditionalGolemCore(EntityGolemBase golem) {
|
||||
String coreName = golem.getDataWatcher().getWatchableObjectString(ModConfig.golemDatawatcherId);
|
||||
if(!coreName.isEmpty()) {
|
||||
return additionalGolemCores.get(coreName);
|
||||
return DefaultApiHandler.additionalGolemCores.get(coreName);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
if(NBTHelper.hasPersistentData(placer)) {
|
||||
NBTTagCompound persistent = NBTHelper.getPersistentData(placer);
|
||||
if(persistent.hasKey("Core")) {
|
||||
return additionalGolemCores.get(persistent.getString("Core"));
|
||||
return DefaultApiHandler.additionalGolemCores.get(persistent.getString("Core"));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -92,9 +92,9 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
|
||||
@Override
|
||||
public boolean registerAdditionalGolemCore(String name, AdditionalGolemCore core) {
|
||||
if(!additionalGolemCores.containsKey(name)) {
|
||||
if(!DefaultApiHandler.additionalGolemCores.containsKey(name)) {
|
||||
core.setName(name);
|
||||
additionalGolemCores.put(name, core);
|
||||
DefaultApiHandler.additionalGolemCores.put(name, core);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -120,7 +120,7 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
|
||||
@Override
|
||||
public List<AdditionalGolemCore> getAdditionalGolemCores() {
|
||||
return new ArrayList<AdditionalGolemCore>(additionalGolemCores.values());
|
||||
return new ArrayList<AdditionalGolemCore>(DefaultApiHandler.additionalGolemCores.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,7 +132,7 @@ public class DefaultApiHandler implements IApiHandler {
|
||||
public void registerAdditionalAuraEffect(Aspect aspect, AuraEffect effect) {
|
||||
if(aspect == null || effect == null) return;
|
||||
if(AuraEffectHandler.registeredEffects.containsKey(aspect)) {
|
||||
log.warn("AuraEffect for '" + aspect.getTag() + "' is already registered!");
|
||||
DefaultApiHandler.log.warn("AuraEffect for '" + aspect.getTag() + "' is already registered!");
|
||||
} else {
|
||||
AuraEffectHandler.registeredEffects.put(aspect, effect);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package makeo.gadomancy.common.aura;
|
||||
|
||||
import makeo.gadomancy.api.AuraEffect;
|
||||
import makeo.gadomancy.common.data.config.ModConfig;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -9,11 +8,7 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
@@ -28,23 +23,23 @@ public class AuraEffectHandler {
|
||||
public static Map<Aspect, AuraEffect> registeredEffects = new HashMap<Aspect, AuraEffect>();
|
||||
|
||||
public static void distributeEffects(Aspect aspect, World worldObj, double x, double y, double z, int tick) {
|
||||
if(!registeredEffects.containsKey(aspect) || worldObj.isRemote || AuraResearchManager.isBlacklisted(aspect)) return;
|
||||
AuraEffect effect = registeredEffects.get(aspect);
|
||||
if(!AuraEffectHandler.registeredEffects.containsKey(aspect) || worldObj.isRemote || AuraResearchManager.isBlacklisted(aspect)) return;
|
||||
AuraEffect effect = AuraEffectHandler.registeredEffects.get(aspect);
|
||||
if((tick % effect.getTickInterval()) != 0) return;
|
||||
|
||||
AuraEffect.EffectType type = effect.getEffectType();
|
||||
if(type != null) {
|
||||
switch (type) {
|
||||
case ENTITY_EFFECT:
|
||||
doEntityEffects(effect, worldObj, x, y, z);
|
||||
AuraEffectHandler.doEntityEffects(effect, worldObj, x, y, z);
|
||||
break;
|
||||
case BLOCK_EFFECT:
|
||||
doBlockEffects(effect, worldObj, x, y, z);
|
||||
AuraEffectHandler.doBlockEffects(effect, worldObj, x, y, z);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
doEntityEffects(effect, worldObj, x, y, z);
|
||||
doBlockEffects(effect, worldObj, x, y, z);
|
||||
AuraEffectHandler.doEntityEffects(effect, worldObj, x, y, z);
|
||||
AuraEffectHandler.doBlockEffects(effect, worldObj, x, y, z);
|
||||
}
|
||||
|
||||
//Distribute research
|
||||
|
||||
@@ -4,12 +4,10 @@ import makeo.gadomancy.api.AuraEffect;
|
||||
import makeo.gadomancy.common.events.EventHandlerEntity;
|
||||
import makeo.gadomancy.common.integration.IntegrationThaumicTinkerer;
|
||||
import makeo.gadomancy.common.registration.RegisteredIntegrations;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import makeo.gadomancy.common.registration.RegisteredPotions;
|
||||
import makeo.gadomancy.common.utils.MiscUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
@@ -38,18 +36,16 @@ import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.config.ConfigEntities;
|
||||
import thaumcraft.common.entities.golems.EntityGolemBase;
|
||||
import thaumcraft.common.entities.monster.EntityBrainyZombie;
|
||||
import thaumcraft.common.entities.monster.boss.EntityThaumcraftBoss;
|
||||
import thaumcraft.common.entities.monster.mods.ChampionModifier;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.research.ScanManager;
|
||||
import thaumcraft.common.lib.utils.EntityUtils;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Random;
|
||||
|
||||
import static makeo.gadomancy.common.utils.MiscUtils.*;
|
||||
import static makeo.gadomancy.common.utils.MiscUtils.ticksForMinutes;
|
||||
import static makeo.gadomancy.common.utils.MiscUtils.ticksForSeconds;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
@@ -252,9 +248,9 @@ public class AuraEffects {
|
||||
|
||||
@Override
|
||||
public void doEntityEffect(ChunkCoordinates originTile, Entity e) {
|
||||
addOrExtendPotionEffect(Potion.damageBoost, (EntityLivingBase) e, ticksForMinutes(3), 30, 1, false);
|
||||
addOrExtendPotionEffect(Potion.moveSpeed, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false);
|
||||
addOrExtendPotionEffect(Potion.regeneration, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false);
|
||||
AuraEffects.addOrExtendPotionEffect(Potion.damageBoost, (EntityLivingBase) e, ticksForMinutes(3), 30, 1, false);
|
||||
AuraEffects.addOrExtendPotionEffect(Potion.moveSpeed, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false);
|
||||
AuraEffects.addOrExtendPotionEffect(Potion.regeneration, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -270,10 +266,10 @@ public class AuraEffects {
|
||||
@Override
|
||||
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
|
||||
EntityBrainyZombie zombie = new EntityBrainyZombie(world);
|
||||
boolean canSpawn = setAndCheckPosition(zombie, selectedBlock, world, true) && zombie.getCanSpawnHere(); //Position for getCanSpawn here is updated.
|
||||
boolean canSpawn = AuraEffects.setAndCheckPosition(zombie, selectedBlock, world, true) && zombie.getCanSpawnHere(); //Position for getCanSpawn here is updated.
|
||||
if(canSpawn) {
|
||||
ChunkCoordinates pos = new ChunkCoordinates((int) zombie.posX, (int) zombie.posY, (int) zombie.posZ);
|
||||
pos = iterateDown(pos, world);
|
||||
pos = AuraEffects.iterateDown(pos, world);
|
||||
zombie.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
|
||||
world.spawnEntityInWorld(zombie);
|
||||
}
|
||||
@@ -350,7 +346,7 @@ public class AuraEffects {
|
||||
public void doEntityEffect(ChunkCoordinates originTile, Entity e) {
|
||||
EntityGolemBase golem = (EntityGolemBase) e;
|
||||
|
||||
addOrExtendPotionEffect(RegisteredPotions.BUFF_GOLEM, golem, ticksForMinutes(6), 10, 0, false);
|
||||
AuraEffects.addOrExtendPotionEffect(RegisteredPotions.BUFF_GOLEM, golem, ticksForMinutes(6), 10, 0, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -371,7 +367,7 @@ public class AuraEffects {
|
||||
|
||||
@Override
|
||||
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
|
||||
waterLocation(selectedBlock, world);
|
||||
AuraEffects.waterLocation(selectedBlock, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -387,7 +383,7 @@ public class AuraEffects {
|
||||
|
||||
@Override
|
||||
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
|
||||
waterLocation(selectedBlock, world);
|
||||
AuraEffects.waterLocation(selectedBlock, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -461,7 +457,7 @@ public class AuraEffects {
|
||||
@Override
|
||||
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
|
||||
EntityLiving mob = world.rand.nextBoolean() ? new EntitySkeleton(world) : new EntityZombie(world);
|
||||
if(setAndCheckPosition(mob, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL) {
|
||||
if(AuraEffects.setAndCheckPosition(mob, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL) {
|
||||
for(int i = 0; i < 5; i++) {
|
||||
mob.setCurrentItemOrArmor(i, null);
|
||||
}
|
||||
@@ -471,7 +467,7 @@ public class AuraEffects {
|
||||
do {
|
||||
int slot = mob.getEquipmentInSlot(0) == null ? 0 : (mob.getEquipmentInSlot(4) == null ? 4 : (world.rand.nextInt(3)+1));
|
||||
if(mob.getEquipmentInSlot(slot) == null) {
|
||||
ItemStack[] items = ITEMS_SOUL[slot];
|
||||
ItemStack[] items = AuraEffects.ITEMS_SOUL[slot];
|
||||
ItemStack stack = items[world.rand.nextInt(items.length)];
|
||||
if(stack.getItem() != Items.bow || mob instanceof EntitySkeleton) {
|
||||
totalCount--;
|
||||
@@ -486,7 +482,7 @@ public class AuraEffects {
|
||||
mob.addPotionEffect(new PotionEffect(Potion.invisibility.getId(), MiscUtils.ticksForMinutes(60*24*365), 1, true));
|
||||
|
||||
ChunkCoordinates pos = new ChunkCoordinates((int) mob.posX, (int) mob.posY, (int) mob.posZ);
|
||||
pos = iterateDown(pos, world);
|
||||
pos = AuraEffects.iterateDown(pos, world);
|
||||
mob.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
|
||||
world.spawnEntityInWorld(mob);
|
||||
}
|
||||
@@ -507,10 +503,10 @@ public class AuraEffects {
|
||||
slime.writeEntityToNBT(data);
|
||||
data.setInteger("Size", 0);
|
||||
slime.readEntityFromNBT(data);
|
||||
boolean canSpawn = setAndCheckPosition(slime, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL;
|
||||
boolean canSpawn = AuraEffects.setAndCheckPosition(slime, selectedBlock, world, true) && world.difficultySetting != EnumDifficulty.PEACEFUL;
|
||||
if(canSpawn) {
|
||||
ChunkCoordinates pos = new ChunkCoordinates((int) slime.posX, (int) slime.posY, (int) slime.posZ);
|
||||
pos = iterateDown(pos, world);
|
||||
pos = AuraEffects.iterateDown(pos, world);
|
||||
slime.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
|
||||
world.spawnEntityInWorld(slime);
|
||||
}
|
||||
@@ -523,7 +519,7 @@ public class AuraEffects {
|
||||
}.register(Aspect.SLIME);
|
||||
public static final AuraEffect BESTIA = new AuraEffect.BlockAuraEffect() {
|
||||
|
||||
private final Class[] animalClasses = new Class[] { EntitySheep.class, EntityCow.class, EntityChicken.class, EntityPig.class };
|
||||
private final Class[] animalClasses = { EntitySheep.class, EntityCow.class, EntityChicken.class, EntityPig.class };
|
||||
|
||||
@Override
|
||||
public int getBlockCount(Random random) {
|
||||
@@ -532,17 +528,17 @@ public class AuraEffects {
|
||||
|
||||
@Override
|
||||
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
|
||||
Class animalClass = animalClasses[world.rand.nextInt(animalClasses.length)];
|
||||
Class animalClass = this.animalClasses[world.rand.nextInt(this.animalClasses.length)];
|
||||
EntityLivingBase animal;
|
||||
try {
|
||||
animal = (EntityLivingBase) animalClass.getConstructor(World.class).newInstance(world);
|
||||
} catch (Exception e) {
|
||||
return;
|
||||
}
|
||||
boolean canSpawn = setAndCheckPosition(animal, selectedBlock, world, true);
|
||||
boolean canSpawn = AuraEffects.setAndCheckPosition(animal, selectedBlock, world, true);
|
||||
if(canSpawn) {
|
||||
ChunkCoordinates pos = new ChunkCoordinates((int) animal.posX, (int) animal.posY, (int) animal.posZ);
|
||||
pos = iterateDown(pos, world);
|
||||
pos = AuraEffects.iterateDown(pos, world);
|
||||
animal.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5);
|
||||
world.spawnEntityInWorld(animal);
|
||||
}
|
||||
@@ -584,12 +580,12 @@ public class AuraEffects {
|
||||
if (e == null || !(e instanceof EntityLivingBase)) return;
|
||||
|
||||
EntityLivingBase living = (EntityLivingBase) e;
|
||||
addOrExtendPotionEffect(potion, living, durationCap, addedDuration, amplifier);
|
||||
AuraEffects.addOrExtendPotionEffect(this.potion, living, this.durationCap, this.addedDuration, this.amplifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTickInterval() {
|
||||
return tickInterval;
|
||||
return this.tickInterval;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,7 +618,7 @@ public class AuraEffects {
|
||||
}
|
||||
|
||||
private static void addOrExtendPotionEffect(Potion potion, EntityLivingBase entityLiving, int cap, int durToAdd, int amplifier) {
|
||||
addOrExtendPotionEffect(potion, entityLiving, cap, durToAdd, amplifier, true);
|
||||
AuraEffects.addOrExtendPotionEffect(potion, entityLiving, cap, durToAdd, amplifier, true);
|
||||
}
|
||||
|
||||
private static ChunkCoordinates iterateDown(ChunkCoordinates pos, World world) {
|
||||
@@ -639,11 +635,11 @@ public class AuraEffects {
|
||||
if(!world.isAirBlock(cc.posX, cc.posY, cc.posZ)) {
|
||||
if(!mayVary) return false;
|
||||
ChunkCoordinates up = new ChunkCoordinates(cc.posX, cc.posY + 1, cc.posZ);
|
||||
if(setAndCheckPosition(entity, up, world, false)) {
|
||||
if(AuraEffects.setAndCheckPosition(entity, up, world, false)) {
|
||||
return true;
|
||||
}
|
||||
ChunkCoordinates down = new ChunkCoordinates(cc.posX, cc.posY - 1, cc.posZ);
|
||||
return setAndCheckPosition(entity, down, world, false);
|
||||
return AuraEffects.setAndCheckPosition(entity, down, world, false);
|
||||
}
|
||||
ChunkCoordinates up = new ChunkCoordinates(cc.posX, cc.posY + 1, cc.posZ);
|
||||
if(world.isAirBlock(up.posX, up.posY, up.posZ)) {
|
||||
@@ -657,14 +653,13 @@ public class AuraEffects {
|
||||
}
|
||||
if(!mayVary) return false;
|
||||
ChunkCoordinates hMove = new ChunkCoordinates(cc.posX + 1, cc.posY, cc.posZ );
|
||||
if(setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
if(AuraEffects.setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
hMove = new ChunkCoordinates(cc.posX , cc.posY, cc.posZ + 1);
|
||||
if(setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
if(AuraEffects.setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
hMove = new ChunkCoordinates(cc.posX - 1, cc.posY, cc.posZ );
|
||||
if(setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
if(AuraEffects.setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
hMove = new ChunkCoordinates(cc.posX , cc.posY, cc.posZ - 1);
|
||||
if(setAndCheckPosition(entity, hMove, world, false)) return true;
|
||||
return false;
|
||||
return AuraEffects.setAndCheckPosition(entity, hMove, world, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,12 +4,10 @@ import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.data.config.ModConfig;
|
||||
import makeo.gadomancy.common.network.PacketHandler;
|
||||
import makeo.gadomancy.common.network.packets.PacketTCNotificationText;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
@@ -31,12 +29,12 @@ public class AuraResearchManager {
|
||||
|
||||
public static void tryUnlockAuraEffect(EntityPlayer player, Aspect aspect) {
|
||||
if(!AuraEffectHandler.registeredEffects.containsKey(aspect)) return;
|
||||
if(isBlacklisted(aspect)) return;
|
||||
if(AuraResearchManager.isBlacklisted(aspect)) return;
|
||||
|
||||
if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_EFFECTS")) return;
|
||||
if(!Thaumcraft.proxy.getPlayerKnowledge().hasDiscoveredAspect(player.getCommandSenderName(), aspect)) return;
|
||||
|
||||
String res = String.format(TC_AURA_RESEARCH_STR, aspect.getTag());
|
||||
String res = String.format(AuraResearchManager.TC_AURA_RESEARCH_STR, aspect.getTag());
|
||||
if(ResearchManager.isResearchComplete(player.getCommandSenderName(), res)) return;
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, res);
|
||||
|
||||
@@ -62,8 +60,8 @@ public class AuraResearchManager {
|
||||
public static List<String> getKnowledge(EntityPlayer player) {
|
||||
List<String> lines = new ArrayList<String>();
|
||||
for(Aspect a : AuraEffectHandler.registeredEffects.keySet()) {
|
||||
if(ResearchManager.isResearchComplete(player.getCommandSenderName(), String.format(TC_AURA_RESEARCH_STR, a.getTag()))) {
|
||||
if(!isBlacklisted(a)) lines.add(a.getTag());
|
||||
if(ResearchManager.isResearchComplete(player.getCommandSenderName(), String.format(AuraResearchManager.TC_AURA_RESEARCH_STR, a.getTag()))) {
|
||||
if(!AuraResearchManager.isBlacklisted(a)) lines.add(a.getTag());
|
||||
}
|
||||
}
|
||||
return lines;
|
||||
@@ -79,7 +77,7 @@ public class AuraResearchManager {
|
||||
|
||||
public static void registerAuraResearches() {
|
||||
for(Aspect a : AuraEffectHandler.registeredEffects.keySet()) {
|
||||
new ResearchItem(String.format(TC_AURA_RESEARCH_STR, a.getTag()), Gadomancy.MODID).registerResearchItem();
|
||||
new ResearchItem(String.format(AuraResearchManager.TC_AURA_RESEARCH_STR, a.getTag()), Gadomancy.MODID).registerResearchItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package makeo.gadomancy.common.aura;
|
||||
|
||||
import makeo.gadomancy.common.utils.SimpleResourceLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -59,7 +58,7 @@ public class ResearchPageAuraAspects extends ResearchPage {
|
||||
public static AspectList createPageAspectList(List<String> tagList) {
|
||||
AspectList list = new AspectList();
|
||||
for(String tag : tagList) {
|
||||
Aspect a = createAuraFakeAspect(tag);
|
||||
Aspect a = ResearchPageAuraAspects.createAuraFakeAspect(tag);
|
||||
if(a != null) list.add(a, 0);
|
||||
}
|
||||
return list;
|
||||
@@ -87,7 +86,7 @@ public class ResearchPageAuraAspects extends ResearchPage {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if(headAspect) return super.getName();
|
||||
if(this.headAspect) return super.getName();
|
||||
String tag = super.getTag();
|
||||
if(tag == null || tag.isEmpty() || tag.equals("")) return "";
|
||||
return StatCollector.translateToLocal(tag);
|
||||
|
||||
@@ -19,7 +19,7 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
public class BlockAdditionalEldritchPortal extends BlockEldritchPortal {
|
||||
|
||||
public BlockAdditionalEldritchPortal() {
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,9 +27,9 @@ import java.util.List;
|
||||
public class BlockArcaneDropper extends BlockTransparent {
|
||||
public BlockArcaneDropper() {
|
||||
super(Material.rock);
|
||||
setHardness(3.5f);
|
||||
this.setHardness(3.5f);
|
||||
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,7 +83,7 @@ public class BlockArcaneDropper extends BlockTransparent {
|
||||
super.maxZ = box.maxZ;
|
||||
}
|
||||
|
||||
private static final AxisAlignedBB[] COLLISION_BOXES = new AxisAlignedBB[]{
|
||||
private static final AxisAlignedBB[] COLLISION_BOXES = {
|
||||
AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.3125f, 1),//down
|
||||
AxisAlignedBB.getBoundingBox(0, 0.6875f, 0, 1, 1, 1),//up
|
||||
|
||||
@@ -97,9 +97,9 @@ public class BlockArcaneDropper extends BlockTransparent {
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB boundingBox, List list, Entity entity) {
|
||||
ForgeDirection side = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) & 7);
|
||||
|
||||
for(int i = 0; i < COLLISION_BOXES.length; i++) {
|
||||
for(int i = 0; i < BlockArcaneDropper.COLLISION_BOXES.length; i++) {
|
||||
if(i != side.ordinal()) {
|
||||
this.setBlockBounds(COLLISION_BOXES[i]);
|
||||
this.setBlockBounds(BlockArcaneDropper.COLLISION_BOXES[i]);
|
||||
super.addCollisionBoxesToList(world, x, y, z, boundingBox, list, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileAuraPylon;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileAuraPylonTop;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
|
||||
import makeo.gadomancy.common.network.PacketHandler;
|
||||
import makeo.gadomancy.common.network.packets.PacketStartAnimation;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
@@ -44,11 +43,11 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent
|
||||
|
||||
public BlockAuraPylon() {
|
||||
super(Material.iron);
|
||||
setHardness(10F);
|
||||
setResistance(50F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 1, 0.9375F);
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setHardness(10F);
|
||||
this.setResistance(50F);
|
||||
this.setStepSound(Block.soundTypeStone);
|
||||
this.setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 1, 0.9375F);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,7 +57,7 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
icon = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
this.icon = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
super.registerBlockIcons(ir);
|
||||
}
|
||||
|
||||
@@ -104,7 +103,7 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
|
||||
if(world.getBlockMetadata(x, y, z) != 1) {
|
||||
Block up = world.getBlock(x, y + 1, z);
|
||||
return up != null && up instanceof BlockAuraPylon && up.onBlockActivated(world, x, y + 1, z, player, side, par7, par8, par9);
|
||||
return up instanceof BlockAuraPylon && up.onBlockActivated(world, x, y + 1, z, player, side, par7, par8, par9);
|
||||
}
|
||||
ItemStack heldItem = player.getHeldItem();
|
||||
if(!world.isRemote && heldItem != null && heldItem.getItem() instanceof ItemWandCasting &&
|
||||
@@ -122,7 +121,7 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent
|
||||
ta.setTileInformation(false, true);
|
||||
int count = 1;
|
||||
TileEntity iter = world.getTileEntity(x, y - count, z);
|
||||
while(iter != null && iter instanceof TileAuraPylon) {
|
||||
while (iter instanceof TileAuraPylon) {
|
||||
((TileAuraPylon) iter).setPartOfMultiblock(true);
|
||||
world.markBlockForUpdate(x, y - count, z);
|
||||
iter.markDirty();
|
||||
@@ -153,6 +152,6 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent
|
||||
|
||||
@Override
|
||||
public IIcon getTransparentIcon() {
|
||||
return icon;
|
||||
return this.icon;
|
||||
}
|
||||
}
|
||||
@@ -38,11 +38,11 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra
|
||||
|
||||
public BlockEssentiaCompressor() {
|
||||
super(Material.wood);
|
||||
setHardness(5F);
|
||||
setResistance(20F);
|
||||
setHarvestLevel("axe", 1);
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setHardness(5F);
|
||||
this.setResistance(20F);
|
||||
this.setHarvestLevel("axe", 1);
|
||||
this.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,13 +57,13 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
icon = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
this.icon = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
super.registerBlockIcons(ir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTransparentIcon() {
|
||||
return icon;
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,13 +108,13 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra
|
||||
}
|
||||
if(((TileEssentiaCompressor) te).isMultiblockFormed()) {
|
||||
if(((TileEssentiaCompressor) te).isMasterTile()) {
|
||||
setBlockBounds(0, 0, 0, 1, 3, 1); //master is lowest tile here.
|
||||
this.setBlockBounds(0, 0, 0, 1, 3, 1); //master is lowest tile here.
|
||||
} else {
|
||||
int yM = ((TileEssentiaCompressor) te).getMultiblockYIndex();
|
||||
setBlockBounds(0, -yM, 0, 1, 3 - yM, 1);
|
||||
this.setBlockBounds(0, -yM, 0, 1, 3 - yM, 1);
|
||||
}
|
||||
} else {
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
this.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,8 +132,8 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra
|
||||
ItemStack heldItem = player.getHeldItem();
|
||||
if(heldItem != null && heldItem.getItem() instanceof ItemWandCasting &&
|
||||
ResearchManager.isResearchComplete(player.getCommandSenderName(), SimpleResearchItem.getFullName("ESSENTIA_COMPRESSOR"))) {
|
||||
ChunkCoordinates lowest = findLowestCompressorBlock(world, x, y, z);
|
||||
boolean canForm = lowest != null && isMuliblockPossible(world, lowest);
|
||||
ChunkCoordinates lowest = this.findLowestCompressorBlock(world, x, y, z);
|
||||
boolean canForm = lowest != null && this.isMuliblockPossible(world, lowest);
|
||||
if(canForm && ThaumcraftApiHelper.consumeVisFromWandCrafting(player.getCurrentEquippedItem(), player, RegisteredRecipes.costsCompressorMultiblock, true)) {
|
||||
int multiblockID = TileEssentiaCompressor.getAndIncrementNewMultiblockId();
|
||||
TileEssentiaCompressor compressor = (TileEssentiaCompressor) world.getTileEntity(lowest.posX, lowest.posY, lowest.posZ);
|
||||
@@ -159,15 +159,15 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra
|
||||
|
||||
private boolean isMuliblockPossible(World world, ChunkCoordinates lowest) {
|
||||
return lowest != null &&
|
||||
isMultiblockable(world, lowest.posX, lowest.posY , lowest.posZ) &&
|
||||
isMultiblockable(world, lowest.posX, lowest.posY + 1, lowest.posZ) &&
|
||||
isMultiblockable(world, lowest.posX, lowest.posY + 2, lowest.posZ);
|
||||
this.isMultiblockable(world, lowest.posX, lowest.posY , lowest.posZ) &&
|
||||
this.isMultiblockable(world, lowest.posX, lowest.posY + 1, lowest.posZ) &&
|
||||
this.isMultiblockable(world, lowest.posX, lowest.posY + 2, lowest.posZ);
|
||||
}
|
||||
|
||||
private ChunkCoordinates findLowestCompressorBlock(World world, int x, int y, int z) {
|
||||
ChunkCoordinates result = null;
|
||||
for (int i = 0; i <= y; i++) {
|
||||
if(!isMultiblockable(world, x, y - i, z)) break;
|
||||
if(!this.isMultiblockable(world, x, y - i, z)) break;
|
||||
result = new ChunkCoordinates(x, y - i, z);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -39,10 +39,10 @@ public class BlockExtendedNodeJar extends BlockContainer {
|
||||
|
||||
public BlockExtendedNodeJar() {
|
||||
super(Material.glass);
|
||||
setHardness(0.3F);
|
||||
setStepSound(new CustomStepSound("jar", 1.0F, 1.0F));
|
||||
setLightLevel(0.66F);
|
||||
setBlockName("blockExNodeJar");
|
||||
this.setHardness(0.3F);
|
||||
this.setStepSound(new CustomStepSound("jar", 1.0F, 1.0F));
|
||||
this.setLightLevel(0.66F);
|
||||
this.setBlockName("blockExNodeJar");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,7 +78,7 @@ public class BlockExtendedNodeJar extends BlockContainer {
|
||||
|
||||
|
||||
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
|
||||
dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
|
||||
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
|
||||
}
|
||||
|
||||
@@ -102,12 +102,12 @@ public class BlockExtendedNodeJar extends BlockContainer {
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int i, int j, int k) {
|
||||
setBlockBounds(0.1875F, 0.0F, 0.1875F, 0.8125F, 0.75F, 0.8125F);
|
||||
this.setBlockBounds(0.1875F, 0.0F, 0.1875F, 0.8125F, 0.75F, 0.8125F);
|
||||
super.setBlockBoundsBasedOnState(world, i, j, k);
|
||||
}
|
||||
|
||||
public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ import net.minecraft.world.World;
|
||||
public class BlockInfusionClaw extends BlockTransparent {
|
||||
public BlockInfusionClaw() {
|
||||
super(Material.rock);
|
||||
setHardness(3.5f);
|
||||
this.setHardness(3.5f);
|
||||
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -16,7 +15,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
@@ -34,8 +32,8 @@ public class BlockKnowledgeBook extends BlockContainer implements IBlockTranspar
|
||||
|
||||
public BlockKnowledgeBook() {
|
||||
super(Material.circuits);
|
||||
setBlockBounds(0.0625F, 0.125F, 0.0625F, 0.9375F, 0.5F, 0.9375F);
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setBlockBounds(0.0625F, 0.125F, 0.0625F, 0.9375F, 0.5F, 0.9375F);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,7 +48,7 @@ public class BlockKnowledgeBook extends BlockContainer implements IBlockTranspar
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
icon = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
this.icon = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
super.registerBlockIcons(ir);
|
||||
}
|
||||
|
||||
@@ -75,16 +73,16 @@ public class BlockKnowledgeBook extends BlockContainer implements IBlockTranspar
|
||||
Block lower = world.getBlock(x, y - 1, z);
|
||||
int metaLower = world.getBlockMetadata(x, y - 1, z);
|
||||
if(!lower.equals(ConfigBlocks.blockStoneDevice) || metaLower != 1) {
|
||||
breakThisBlock(world, x, y, z);
|
||||
this.breakThisBlock(world, x, y, z);
|
||||
}
|
||||
if(!world.isAirBlock(x, y + 1, z)) {
|
||||
breakThisBlock(world, x, y, z);
|
||||
this.breakThisBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void breakThisBlock(World world, int x, int y, int z) {
|
||||
private void breakThisBlock(World world, int x, int y, int z) {
|
||||
if(world.isRemote) return;
|
||||
ArrayList<ItemStack> stacks = getDrops(world, x, y, z, 0, 0);
|
||||
ArrayList<ItemStack> stacks = this.getDrops(world, x, y, z, 0, 0);
|
||||
for(ItemStack i : stacks) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, i);
|
||||
world.spawnEntityInWorld(item);
|
||||
@@ -103,7 +101,7 @@ public class BlockKnowledgeBook extends BlockContainer implements IBlockTranspar
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int p_149736_5_) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileKnowledgeBook) {
|
||||
if (te instanceof TileKnowledgeBook) {
|
||||
if(((TileKnowledgeBook) te).isResearching()) {
|
||||
if(((TileKnowledgeBook) te).hasCognitio()) {
|
||||
return 15;
|
||||
@@ -121,7 +119,7 @@ public class BlockKnowledgeBook extends BlockContainer implements IBlockTranspar
|
||||
|
||||
@Override
|
||||
public IIcon getTransparentIcon() {
|
||||
return icon;
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,21 +28,21 @@ import java.util.List;
|
||||
public class BlockNodeManipulator extends BlockStoneDevice {
|
||||
|
||||
public BlockNodeManipulator() {
|
||||
setBlockName("blockNodeManipulator");
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setBlockName("blockNodeManipulator");
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
|
||||
iconPedestal[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_bot");
|
||||
iconWandPedestal[0] = ir.registerIcon(Gadomancy.MODID + ":manipulator_side");
|
||||
iconWandPedestal[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_top");
|
||||
this.iconPedestal[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_bot");
|
||||
this.iconWandPedestal[0] = ir.registerIcon(Gadomancy.MODID + ":manipulator_side");
|
||||
this.iconWandPedestal[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_top");
|
||||
|
||||
iconWandPedestalFocus[0] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_side");
|
||||
iconWandPedestalFocus[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_top");
|
||||
iconWandPedestalFocus[2] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_bot");
|
||||
this.iconWandPedestalFocus[0] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_side");
|
||||
this.iconWandPedestalFocus[1] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_top");
|
||||
this.iconWandPedestalFocus[2] = ir.registerIcon(Gadomancy.MODID + ":manipulator_focus_bot");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +63,7 @@ public class BlockNodeManipulator extends BlockStoneDevice {
|
||||
int ret = super.getComparatorInputOverride(world, x, y, z, rs);
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof TileNodeManipulator) return 0;
|
||||
if (te instanceof TileNodeManipulator) return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
*/
|
||||
public class BlockRemoteJar extends BlockJar {
|
||||
public BlockRemoteJar() {
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,7 +59,7 @@ public class BlockRemoteJar extends BlockJar {
|
||||
if(drop.getItem() == ConfigItems.itemJarFilled || drop.getItem() == Item.getItemFromBlock(this)) {
|
||||
drop.func_150996_a(Item.getItemFromBlock(this));
|
||||
|
||||
TileRemoteJar tile = getJarTile(world, x, y, z);
|
||||
TileRemoteJar tile = BlockRemoteJar.getJarTile(world, x, y, z);
|
||||
if(tile.networkId != null) {
|
||||
NBTHelper.setUUID(NBTHelper.getData(drop), "networkId", tile.networkId);
|
||||
}
|
||||
@@ -93,6 +93,6 @@ public class BlockRemoteJar extends BlockJar {
|
||||
}
|
||||
|
||||
public static TileRemoteJar getJarTile(World world, int x, int y, int z) {
|
||||
return getJarTile(world.getTileEntity(x, y, z));
|
||||
return BlockRemoteJar.getJarTile(world.getTileEntity(x, y, z));
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ import java.util.Map;
|
||||
public class BlockStickyJar extends BlockJar implements IBlockTransparent {
|
||||
|
||||
public BlockStickyJar() {
|
||||
setCreativeTab(null);
|
||||
this.setCreativeTab(null);
|
||||
}
|
||||
|
||||
private IIcon iconTransparent;
|
||||
@@ -55,18 +55,18 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent {
|
||||
return stickyJar.getParentBlock().getIcon(world, x, y, z, side);
|
||||
}
|
||||
}
|
||||
return iconTransparent;
|
||||
return this.iconTransparent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
super.registerBlockIcons(ir);
|
||||
iconTransparent = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
this.iconTransparent = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTransparentIcon() {
|
||||
return iconTransparent;
|
||||
return this.iconTransparent;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
@@ -74,7 +74,7 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent {
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileStickyJar) {
|
||||
flipBlockBounds((TileStickyJar) tile);
|
||||
this.flipBlockBounds((TileStickyJar) tile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,12 +82,12 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent {
|
||||
ForgeDirection placedOn = stickyJar.placedOn;
|
||||
|
||||
if (placedOn != ForgeDirection.DOWN) {
|
||||
float minX = (float) getBlockBoundsMinX();
|
||||
float minY = (float) getBlockBoundsMinY();
|
||||
float minZ = (float) getBlockBoundsMinZ();
|
||||
float maxX = (float) getBlockBoundsMaxX();
|
||||
float maxY = (float) getBlockBoundsMaxY();
|
||||
float maxZ = (float) getBlockBoundsMaxZ();
|
||||
float minX = (float) this.getBlockBoundsMinX();
|
||||
float minY = (float) this.getBlockBoundsMinY();
|
||||
float minZ = (float) this.getBlockBoundsMinZ();
|
||||
float maxX = (float) this.getBlockBoundsMaxX();
|
||||
float maxY = (float) this.getBlockBoundsMaxY();
|
||||
float maxZ = (float) this.getBlockBoundsMaxZ();
|
||||
|
||||
float temp;
|
||||
if (placedOn == ForgeDirection.NORTH || placedOn == ForgeDirection.SOUTH) {
|
||||
@@ -199,7 +199,7 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent {
|
||||
stickyJar.getParentBlock().onBlockPlacedBy(world, x, y, z, ent, stack);
|
||||
}
|
||||
|
||||
onBlockPlacedOn(stickyJar, ent);
|
||||
this.onBlockPlacedOn(stickyJar, ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent {
|
||||
|
||||
if (info.needsPhialHandling() && heldItem != null && heldItem.getItem() == ConfigItems.itemEssence) {
|
||||
if(!world.isRemote) {
|
||||
handlePhial(world, x, y, z, player, heldItem, tileStickyJar);
|
||||
BlockStickyJar.handlePhial(world, x, y, z, player, heldItem, tileStickyJar);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package makeo.gadomancy.common.blocks;
|
||||
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.blocks.tiles.*;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileArcanePackager;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileBlockProtector;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileManipulationFocus;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileManipulatorPillar;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import makeo.gadomancy.common.utils.ItemUtils;
|
||||
@@ -41,46 +44,46 @@ import java.util.Random;
|
||||
public class BlockStoneMachine extends Block {
|
||||
public BlockStoneMachine() {
|
||||
super(Material.rock);
|
||||
setHardness(3.0F);
|
||||
setResistance(25.0F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
setCreativeTab(RegisteredItems.creativeTab);
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(25.0F);
|
||||
this.setStepSound(Block.soundTypeStone);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.setCreativeTab(RegisteredItems.creativeTab);
|
||||
}
|
||||
|
||||
private IIcon pillarIcon;
|
||||
private IIcon focusIcon;
|
||||
public IIcon pedestalSideIcon;
|
||||
public IIcon pedestalTopIcon;
|
||||
public IIcon protectorIcon;
|
||||
public IIcon packagerIcon;
|
||||
private IIcon protectorIcon;
|
||||
private IIcon packagerIcon;
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
pillarIcon = ir.registerIcon("thaumcraft:es_1");
|
||||
focusIcon = ir.registerIcon("thaumcraft:thaumiumblock");
|
||||
pedestalTopIcon = ir.registerIcon(Gadomancy.MODID + ":manipulator_bot");
|
||||
pedestalSideIcon = ir.registerIcon(Gadomancy.MODID + ":ancient_pedestal_side");
|
||||
protectorIcon = ir.registerIcon("thaumcraft:pipe_1");
|
||||
packagerIcon = ir.registerIcon("thaumcraft:planks_greatwood");
|
||||
this.pillarIcon = ir.registerIcon("thaumcraft:es_1");
|
||||
this.focusIcon = ir.registerIcon("thaumcraft:thaumiumblock");
|
||||
this.pedestalTopIcon = ir.registerIcon(Gadomancy.MODID + ":manipulator_bot");
|
||||
this.pedestalSideIcon = ir.registerIcon(Gadomancy.MODID + ":ancient_pedestal_side");
|
||||
this.protectorIcon = ir.registerIcon("thaumcraft:pipe_1");
|
||||
this.packagerIcon = ir.registerIcon("thaumcraft:planks_greatwood");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if (metadata == 11 || metadata == 15) {
|
||||
return pillarIcon;
|
||||
return this.pillarIcon;
|
||||
} else if (metadata == 0 || metadata == 3) {
|
||||
return focusIcon;
|
||||
return this.focusIcon;
|
||||
} else if (metadata == 1) {
|
||||
if (side > 1) {
|
||||
return pedestalSideIcon;
|
||||
return this.pedestalSideIcon;
|
||||
} else {
|
||||
return pedestalTopIcon;
|
||||
return this.pedestalTopIcon;
|
||||
}
|
||||
} else if (metadata == 2) {
|
||||
return protectorIcon;
|
||||
return this.protectorIcon;
|
||||
} else if(metadata == 4) {
|
||||
return packagerIcon;
|
||||
return this.packagerIcon;
|
||||
}
|
||||
|
||||
return super.getIcon(side, metadata);
|
||||
@@ -102,7 +105,7 @@ public class BlockStoneMachine extends Block {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (metadata == 11 || metadata == 15) {
|
||||
return new ItemStack(getItemDropped(metadata, null, 0), 1, damageDropped(metadata));
|
||||
return new ItemStack(this.getItemDropped(metadata, null, 0), 1, this.damageDropped(metadata));
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z, player);
|
||||
@@ -192,17 +195,17 @@ public class BlockStoneMachine extends Block {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (metadata == 15) {
|
||||
if (world.getBlock(x, y + 1, z) != this || world.getBlockMetadata(x, y + 1, z) != 11) {
|
||||
dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
this.dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
} else if (metadata == 11) {
|
||||
if (world.getBlock(x, y - 1, z) != this || world.getBlockMetadata(x, y - 1, z) != 15) {
|
||||
dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
this.dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
} else if (metadata == 0 || metadata == 3) {
|
||||
if (world.getBlock(x, y - 1, z) != RegisteredBlocks.blockNodeManipulator || world.getBlockMetadata(x, y - 1, z) != 5) {
|
||||
dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
this.dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
} else if(metadata == 1) {
|
||||
@@ -267,17 +270,17 @@ public class BlockStoneMachine extends Block {
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (metadata == 15) {
|
||||
setBlockBounds(0, 0, 0, 1, 0.5f, 1);
|
||||
this.setBlockBounds(0, 0, 0, 1, 0.5f, 1);
|
||||
} else if (metadata == 11) {
|
||||
setBlockBounds(0.0F, -1.0F, 0.0F, 1.0F, -0.5F, 1.0F);
|
||||
this.setBlockBounds(0.0F, -1.0F, 0.0F, 1.0F, -0.5F, 1.0F);
|
||||
} else if (metadata == 0 || metadata == 3) {
|
||||
setBlockBounds(3 / 16f, 0, 3 / 16f, 1 - (3 / 16f), 6 / 16f, 1 - (3 / 16f));
|
||||
this.setBlockBounds(3 / 16f, 0, 3 / 16f, 1 - (3 / 16f), 6 / 16f, 1 - (3 / 16f));
|
||||
} else if (metadata == 1) {
|
||||
setBlockBounds(0.25f, 0, 0.25f, 0.75f, 0.99f, 0.75f);
|
||||
this.setBlockBounds(0.25f, 0, 0.25f, 0.75f, 0.99f, 0.75f);
|
||||
} else if(metadata == 2) {
|
||||
setBlockBounds(0, 0, 0, 1, 3/16f, 1);
|
||||
this.setBlockBounds(0, 0, 0, 1, 3/16f, 1);
|
||||
} else if(metadata == 4) {
|
||||
setBlockBounds(0, 0, 0, 1, 12/16f, 1);
|
||||
this.setBlockBounds(0, 0, 0, 1, 12/16f, 1);
|
||||
}/* else if(metadata == 5) {
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
}*/
|
||||
@@ -288,13 +291,13 @@ public class BlockStoneMachine extends Block {
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, Entity entity) {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (metadata == 11 || metadata == 15 || metadata == 1) {
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
this.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
} else if(metadata == 2) {
|
||||
setBlockBounds(3 / 16f, 0, 3 / 16f, 1 - (3 / 16f), 9.5f/16f, 1 - (3 / 16f));
|
||||
this.setBlockBounds(3 / 16f, 0, 3 / 16f, 1 - (3 / 16f), 9.5f/16f, 1 - (3 / 16f));
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
} else {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
}
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ public abstract class BlockTransparent extends Block implements IBlockTransparen
|
||||
private IIcon iconTransparent;
|
||||
|
||||
public IIcon getTransparentIcon() {
|
||||
return iconTransparent;
|
||||
return this.iconTransparent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
iconTransparent = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
this.iconTransparent = ir.registerIcon(Gadomancy.MODID + ":transparent");
|
||||
super.registerBlockIcons(ir);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,31 +18,31 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
public class SynchronizedTileEntity extends TileEntity {
|
||||
|
||||
public ChunkCoordinates getCoords() {
|
||||
return new ChunkCoordinates(xCoord, yCoord, zCoord);
|
||||
return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public final void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
readCustomNBT(compound);
|
||||
this.readCustomNBT(compound);
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound compound) {}
|
||||
|
||||
public final void writeToNBT(NBTTagCompound compound) {
|
||||
super.writeToNBT(compound);
|
||||
writeCustomNBT(compound);
|
||||
this.writeCustomNBT(compound);
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound compound) {}
|
||||
|
||||
public final Packet getDescriptionPacket() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
writeCustomNBT(compound);
|
||||
this.writeCustomNBT(compound);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 255, compound);
|
||||
}
|
||||
|
||||
public final void onDataPacket(NetworkManager manager, S35PacketUpdateTileEntity paket) {
|
||||
super.onDataPacket(manager, paket);
|
||||
readCustomNBT(paket.func_148857_g());
|
||||
this.readCustomNBT(paket.func_148857_g());
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,7 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import makeo.gadomancy.client.effect.fx.Orbital;
|
||||
import makeo.gadomancy.common.registration.AIShutdownWhitelist;
|
||||
import makeo.gadomancy.common.registration.RegisteredMultiblocks;
|
||||
import makeo.gadomancy.common.utils.Injector;
|
||||
import makeo.gadomancy.common.utils.MultiblockHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
@@ -24,12 +21,7 @@ import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
@@ -51,8 +43,8 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
public Orbital orbital;
|
||||
|
||||
private int ticksExisted = 0;
|
||||
private int storedAmount = 0;
|
||||
private int ticksExisted;
|
||||
private int storedAmount;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
@@ -61,34 +53,34 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(worldObj == null) return;
|
||||
ticksExisted++;
|
||||
if(this.worldObj == null) return;
|
||||
this.ticksExisted++;
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
ChunkCoordinates cc = getCoords();
|
||||
if (!trackedEntities.containsKey(cc)) trackedEntities.put(cc, Lists.<AffectedEntity>newLinkedList());
|
||||
if(!this.worldObj.isRemote) {
|
||||
ChunkCoordinates cc = this.getCoords();
|
||||
if (!TileAIShutdown.trackedEntities.containsKey(cc)) TileAIShutdown.trackedEntities.put(cc, Lists.newLinkedList());
|
||||
|
||||
if ((ticksExisted & 15) == 0) {
|
||||
killAI();
|
||||
if ((this.ticksExisted & 15) == 0) {
|
||||
this.killAI();
|
||||
}
|
||||
if (((ticksExisted & 7) == 0)) {
|
||||
handleIO();
|
||||
if (((this.ticksExisted & 7) == 0)) {
|
||||
this.handleIO();
|
||||
}
|
||||
if (((ticksExisted & 31) == 0)) {
|
||||
drainDefaultEssentia();
|
||||
if (((this.ticksExisted & 31) == 0)) {
|
||||
this.drainDefaultEssentia();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void drainDefaultEssentia() {
|
||||
storedAmount = Math.max(0, storedAmount - 1);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
this.storedAmount = Math.max(0, this.storedAmount - 1);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
private void handleIO() {
|
||||
if (storedAmount < MAX_AMT) {
|
||||
if (this.storedAmount < TileAIShutdown.MAX_AMT) {
|
||||
TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.UP);
|
||||
if (te != null) {
|
||||
IEssentiaTransport ic = (IEssentiaTransport) te;
|
||||
@@ -96,32 +88,32 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
return;
|
||||
}
|
||||
|
||||
if (ic.getSuctionAmount(ForgeDirection.DOWN) < getSuctionAmount(ForgeDirection.UP)) {
|
||||
addToContainer(Aspect.ENTROPY, ic.takeEssentia(Aspect.ENTROPY, 1, ForgeDirection.DOWN));
|
||||
if (ic.getSuctionAmount(ForgeDirection.DOWN) < this.getSuctionAmount(ForgeDirection.UP)) {
|
||||
this.addToContainer(Aspect.ENTROPY, ic.takeEssentia(Aspect.ENTROPY, 1, ForgeDirection.DOWN));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void killAI() {
|
||||
ChunkCoordinates cc = getCoords();
|
||||
List objEntityList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, BOX.copy().offset(xCoord, yCoord, zCoord));
|
||||
ChunkCoordinates cc = this.getCoords();
|
||||
List objEntityList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, TileAIShutdown.BOX.copy().offset(this.xCoord, this.yCoord, this.zCoord));
|
||||
for (Object o : objEntityList) {
|
||||
if(o != null && o instanceof EntityLiving &&
|
||||
!((EntityLiving) o).isDead && canAffect((EntityLiving) o)) {
|
||||
!((EntityLiving) o).isDead && this.canAffect((EntityLiving) o)) {
|
||||
EntityLiving el = (EntityLiving) o;
|
||||
if(storedAmount <= 0) return;
|
||||
AffectedEntity affected = removeAI(el);
|
||||
trackedEntities.get(cc).add(affected);
|
||||
if(this.storedAmount <= 0) return;
|
||||
AffectedEntity affected = this.removeAI(el);
|
||||
TileAIShutdown.trackedEntities.get(cc).add(affected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private AffectedEntity removeAI(EntityLiving el) {
|
||||
if(RAND.nextInt(4) == 0) {
|
||||
storedAmount = Math.max(0, storedAmount - 1);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
if(TileAIShutdown.RAND.nextInt(4) == 0) {
|
||||
this.storedAmount = Math.max(0, this.storedAmount - 1);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
UUID uu = el.getUniqueID();
|
||||
@@ -157,21 +149,21 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
injEntityLivingBase.setObject(el);
|
||||
injEntityLivingBase.setField("ignoreCollisions", true);
|
||||
injEntityLivingBase.setObject(null);
|
||||
TileAIShutdown.injEntityLivingBase.setObject(el);
|
||||
TileAIShutdown.injEntityLivingBase.setField("ignoreCollisions", true);
|
||||
TileAIShutdown.injEntityLivingBase.setObject(null);
|
||||
return new AffectedEntity(uu, tasks, targetTasks);
|
||||
}
|
||||
|
||||
public int getStoredEssentia() {
|
||||
return storedAmount;
|
||||
return this.storedAmount;
|
||||
}
|
||||
|
||||
public boolean canAffect(EntityLiving el) {
|
||||
ChunkCoordinates cc = getCoords();
|
||||
if(!trackedEntities.containsKey(cc)) return false;
|
||||
ChunkCoordinates cc = this.getCoords();
|
||||
if(!TileAIShutdown.trackedEntities.containsKey(cc)) return false;
|
||||
UUID uu = el.getUniqueID();
|
||||
for (AffectedEntity ae : trackedEntities.get(cc)) {
|
||||
for (AffectedEntity ae : TileAIShutdown.trackedEntities.get(cc)) {
|
||||
if(ae.eUUID.equals(uu)) return false;
|
||||
}
|
||||
return true;
|
||||
@@ -184,7 +176,7 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("amount", storedAmount);
|
||||
compound.setInteger("amount", this.storedAmount);
|
||||
}
|
||||
|
||||
|
||||
@@ -194,8 +186,8 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
if(storedAmount <= 0) return new AspectList();
|
||||
return new AspectList().add(Aspect.ENTROPY, storedAmount);
|
||||
if(this.storedAmount <= 0) return new AspectList();
|
||||
return new AspectList().add(Aspect.ENTROPY, this.storedAmount);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -214,12 +206,12 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
if (aspect == null) return 0;
|
||||
|
||||
if (storedAmount < MAX_AMT) {
|
||||
int added = Math.min(amount, MAX_AMT - storedAmount);
|
||||
storedAmount += added;
|
||||
if (this.storedAmount < TileAIShutdown.MAX_AMT) {
|
||||
int added = Math.min(amount, TileAIShutdown.MAX_AMT - this.storedAmount);
|
||||
this.storedAmount += added;
|
||||
amount -= added;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
markDirty();
|
||||
this.markDirty();
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
@@ -253,17 +245,17 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public boolean isConnectable(ForgeDirection direction) {
|
||||
return direction != null && direction.equals(ForgeDirection.UP);
|
||||
return ForgeDirection.UP.equals(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInputFrom(ForgeDirection direction) {
|
||||
return isConnectable(direction);
|
||||
return this.isConnectable(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOutputTo(ForgeDirection direction) {
|
||||
return isConnectable(direction);
|
||||
return this.isConnectable(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,14 +263,14 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public Aspect getSuctionType(ForgeDirection direction) {
|
||||
if(!isConnectable(direction)) return null;
|
||||
if(!this.isConnectable(direction)) return null;
|
||||
return Aspect.ENTROPY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection direction) {
|
||||
if(!isConnectable(direction)) return 0;
|
||||
return getMinimumSuction();
|
||||
if(!this.isConnectable(direction)) return 0;
|
||||
return this.getMinimumSuction();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -288,7 +280,7 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public int addEssentia(Aspect aspect, int i, ForgeDirection direction) {
|
||||
return canInputFrom(direction) ? addToContainer(aspect, i) : 0;
|
||||
return this.canInputFrom(direction) ? this.addToContainer(aspect, i) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -298,8 +290,8 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
@Override
|
||||
public int getEssentiaAmount(ForgeDirection direction) {
|
||||
if(!isConnectable(direction)) return 0;
|
||||
return storedAmount;
|
||||
if(!this.isConnectable(direction)) return 0;
|
||||
return this.storedAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -315,15 +307,15 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
//Tracker methods
|
||||
|
||||
public static void removeTrackedEntity(EntityLiving entityLiving) {
|
||||
for (ChunkCoordinates cc : trackedEntities.keySet()) {
|
||||
for (AffectedEntity ae : trackedEntities.get(cc)) {
|
||||
for (ChunkCoordinates cc : TileAIShutdown.trackedEntities.keySet()) {
|
||||
for (AffectedEntity ae : TileAIShutdown.trackedEntities.get(cc)) {
|
||||
if(ae.eUUID.equals(entityLiving.getUniqueID())) {
|
||||
trackedEntities.get(cc).remove(ae);
|
||||
TileAIShutdown.trackedEntities.get(cc).remove(ae);
|
||||
entityLiving.tasks.taskEntries = ae.tasks;
|
||||
entityLiving.targetTasks.taskEntries = ae.targetTasks;
|
||||
injEntityLivingBase.setObject(entityLiving);
|
||||
injEntityLivingBase.setField("ignoreCollisions", false);
|
||||
injEntityLivingBase.setObject(null);
|
||||
TileAIShutdown.injEntityLivingBase.setObject(entityLiving);
|
||||
TileAIShutdown.injEntityLivingBase.setField("ignoreCollisions", false);
|
||||
TileAIShutdown.injEntityLivingBase.setObject(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -332,21 +324,21 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
public static void removeTrackedEntities(World world, int x, int y, int z) {
|
||||
ChunkCoordinates cc = new ChunkCoordinates(x, y, z);
|
||||
if(trackedEntities.containsKey(cc)) {
|
||||
for (AffectedEntity ae : trackedEntities.get(cc)) {
|
||||
if(TileAIShutdown.trackedEntities.containsKey(cc)) {
|
||||
for (AffectedEntity ae : TileAIShutdown.trackedEntities.get(cc)) {
|
||||
for (Object objE : world.getLoadedEntityList()) {
|
||||
if(objE != null && objE instanceof EntityLiving &&
|
||||
!((EntityLiving) objE).isDead &&
|
||||
((EntityLiving) objE).getUniqueID().equals(ae.eUUID)) {
|
||||
((EntityLiving) objE).tasks.taskEntries = ae.tasks;
|
||||
((EntityLiving) objE).targetTasks.taskEntries = ae.targetTasks;
|
||||
injEntityLivingBase.setObject(objE);
|
||||
injEntityLivingBase.setField("ignoreCollisions", false);
|
||||
injEntityLivingBase.setObject(null);
|
||||
TileAIShutdown.injEntityLivingBase.setObject(objE);
|
||||
TileAIShutdown.injEntityLivingBase.setField("ignoreCollisions", false);
|
||||
TileAIShutdown.injEntityLivingBase.setObject(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
trackedEntities.remove(new ChunkCoordinates(x, y, z));
|
||||
TileAIShutdown.trackedEntities.remove(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,14 +359,14 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null || this.getClass() != o.getClass()) return false;
|
||||
AffectedEntity that = (AffectedEntity) o;
|
||||
return !(eUUID != null ? !eUUID.equals(that.eUUID) : that.eUUID != null);
|
||||
return this.eUUID != null ? this.eUUID.equals(that.eUUID) : that.eUUID == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return eUUID != null ? eUUID.hashCode() : 0;
|
||||
return this.eUUID != null ? this.eUUID.hashCode() : 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class TileAdditionalEldritchPortal extends TileEldritchPortal {
|
||||
|
||||
private static Map<EntityPlayer, ExtendedChunkCoordinates> trackedPortalActivity = new HashMap<EntityPlayer, ExtendedChunkCoordinates>();
|
||||
private EntityPlayer toTeleport;
|
||||
private int count = 0;
|
||||
private int count;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
@@ -39,7 +39,7 @@ public class TileAdditionalEldritchPortal extends TileEldritchPortal {
|
||||
this.opencount += 1;
|
||||
}
|
||||
|
||||
if ((!this.worldObj.isRemote) && (this.count % 5 == 0) && toTeleport == null) {
|
||||
if ((!this.worldObj.isRemote) && (this.count % 5 == 0) && this.toTeleport == null) {
|
||||
List<EntityPlayerMP> players = this.worldObj.getEntitiesWithinAABB(EntityPlayerMP.class, AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1).expand(0.5D, 1.0D, 0.5D));
|
||||
if(players != null && !players.isEmpty()) {
|
||||
EntityPlayerMP toTeleport = players.get(0);
|
||||
@@ -57,7 +57,7 @@ public class TileAdditionalEldritchPortal extends TileEldritchPortal {
|
||||
//Teleporting there.
|
||||
|
||||
if(TCMazeHandler.createSessionWaitForTeleport(toTeleport)) {
|
||||
startTracking(toTeleport, new ExtendedChunkCoordinates(new ChunkCoordinates(xCoord, yCoord, zCoord), toTeleport.dimension));
|
||||
TileAdditionalEldritchPortal.startTracking(toTeleport, new ExtendedChunkCoordinates(new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord), toTeleport.dimension));
|
||||
}
|
||||
} else {
|
||||
//Teleporting back.
|
||||
@@ -69,15 +69,15 @@ public class TileAdditionalEldritchPortal extends TileEldritchPortal {
|
||||
}
|
||||
|
||||
public static void startTracking(EntityPlayer player, ExtendedChunkCoordinates tileCoords) {
|
||||
if(!trackedPortalActivity.containsKey(player)) {
|
||||
trackedPortalActivity.put(player, tileCoords);
|
||||
if(!TileAdditionalEldritchPortal.trackedPortalActivity.containsKey(player)) {
|
||||
TileAdditionalEldritchPortal.trackedPortalActivity.put(player, tileCoords);
|
||||
}
|
||||
}
|
||||
|
||||
public static void informSessionStart(EntityPlayer player) {
|
||||
if(trackedPortalActivity.containsKey(player)) {
|
||||
ExtendedChunkCoordinates tileCoords = trackedPortalActivity.get(player);
|
||||
trackedPortalActivity.remove(player);
|
||||
if(TileAdditionalEldritchPortal.trackedPortalActivity.containsKey(player)) {
|
||||
ExtendedChunkCoordinates tileCoords = TileAdditionalEldritchPortal.trackedPortalActivity.get(player);
|
||||
TileAdditionalEldritchPortal.trackedPortalActivity.remove(player);
|
||||
if(tileCoords != null) {
|
||||
ChunkCoordinates cc = tileCoords.coordinates;
|
||||
WorldServer ws = MinecraftServer.getServer().worldServerForDimension(tileCoords.dimId);
|
||||
|
||||
@@ -23,77 +23,77 @@ import java.util.List;
|
||||
*
|
||||
* Created by makeo @ 28.09.2015 20:13
|
||||
*/
|
||||
public class TileArcaneDropper extends TileEntity implements IInventory, ISidedInventory {
|
||||
public class TileArcaneDropper extends TileEntity implements ISidedInventory {
|
||||
private static final double RADIUS = 1.5;
|
||||
|
||||
private List<EntityItem> items = new ArrayList<EntityItem>();
|
||||
|
||||
private final List<EntityItem> dropQueue = new ArrayList<EntityItem>();
|
||||
|
||||
private int count = 0;
|
||||
private int count;
|
||||
|
||||
private int removedCount = 0;
|
||||
private EntityItem removedEntity = null;
|
||||
private int removedCount;
|
||||
private EntityItem removedEntity;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
removedCount = 0;
|
||||
removedEntity = null;
|
||||
this.removedCount = 0;
|
||||
this.removedEntity = null;
|
||||
|
||||
if(dropQueue.size() > 0) {
|
||||
for(int i = 0; i < dropQueue.size(); i++) {
|
||||
EntityItem item = dropQueue.get(i);
|
||||
if(!item.isDead && !worldObj.loadedEntityList.contains(item)) {
|
||||
getWorldObj().spawnEntityInWorld(item);
|
||||
dropQueue.remove(i);
|
||||
if(this.dropQueue.size() > 0) {
|
||||
for(int i = 0; i < this.dropQueue.size(); i++) {
|
||||
EntityItem item = this.dropQueue.get(i);
|
||||
if(!item.isDead && !this.worldObj.loadedEntityList.contains(item)) {
|
||||
this.getWorldObj().spawnEntityInWorld(item);
|
||||
this.dropQueue.remove(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count > 20) {
|
||||
count = 0;
|
||||
if(this.count > 20) {
|
||||
this.count = 0;
|
||||
|
||||
World world = getWorldObj();
|
||||
World world = this.getWorldObj();
|
||||
if(!world.isRemote) {
|
||||
int oldSize = items.size();
|
||||
updateInventory();
|
||||
if(oldSize != 0 || items.size() != 0) {
|
||||
int oldSize = this.items.size();
|
||||
this.updateInventory();
|
||||
if(oldSize != 0 || this.items.size() != 0) {
|
||||
//Comparator...
|
||||
world.notifyBlockChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
world.notifyBlockChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
|
||||
}
|
||||
}
|
||||
}
|
||||
count++;
|
||||
this.count++;
|
||||
}
|
||||
|
||||
private void updateInventory() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(getBlockMetadata() & 7);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() & 7);
|
||||
|
||||
double x = this.xCoord + dir.offsetX*2 + 0.5;
|
||||
double y = this.yCoord + dir.offsetY*2 + 0.5;
|
||||
double z = this.zCoord + dir.offsetZ*2 + 0.5;
|
||||
|
||||
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(RADIUS, RADIUS, RADIUS);
|
||||
items = getWorldObj().getEntitiesWithinAABB(EntityItem.class, box);
|
||||
AxisAlignedBB box = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(TileArcaneDropper.RADIUS, TileArcaneDropper.RADIUS, TileArcaneDropper.RADIUS);
|
||||
this.items = this.getWorldObj().getEntitiesWithinAABB(EntityItem.class, box);
|
||||
|
||||
//Add 10 empty slots
|
||||
for(int i = 0; i < 10; i++) {
|
||||
items.add(null);
|
||||
this.items.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
private EntityItem dropItem(ItemStack stack) {
|
||||
if(removedEntity != null && removedEntity.isDead) {
|
||||
for(EntityItem entityItem : items) {
|
||||
if(entityItem == removedEntity) {
|
||||
if(InventoryUtils.areItemStacksEqualStrict(removedEntity.getEntityItem(), stack)
|
||||
&& removedEntity.getEntityItem().stackSize + removedCount == stack.stackSize) {
|
||||
removedEntity.getEntityItem().stackSize += removedCount;
|
||||
removedEntity.isDead = false;
|
||||
if(this.removedEntity != null && this.removedEntity.isDead) {
|
||||
for(EntityItem entityItem : this.items) {
|
||||
if(entityItem == this.removedEntity) {
|
||||
if(InventoryUtils.areItemStacksEqualStrict(this.removedEntity.getEntityItem(), stack)
|
||||
&& this.removedEntity.getEntityItem().stackSize + this.removedCount == stack.stackSize) {
|
||||
this.removedEntity.getEntityItem().stackSize += this.removedCount;
|
||||
this.removedEntity.isDead = false;
|
||||
|
||||
removedCount = 0;
|
||||
removedEntity = null;
|
||||
this.removedCount = 0;
|
||||
this.removedEntity = null;
|
||||
|
||||
return entityItem;
|
||||
}
|
||||
@@ -101,13 +101,13 @@ public class TileArcaneDropper extends TileEntity implements IInventory, ISidedI
|
||||
}
|
||||
}
|
||||
|
||||
ForgeDirection side = ForgeDirection.getOrientation(getBlockMetadata() & 7);
|
||||
ForgeDirection side = ForgeDirection.getOrientation(this.getBlockMetadata() & 7);
|
||||
|
||||
double x = this.xCoord + 0.5 + side.offsetX*0.5;
|
||||
double y = this.yCoord + 0.25 + side.offsetY*0.5;
|
||||
double z = this.zCoord + 0.5 + side.offsetZ*0.5;
|
||||
|
||||
EntityItem entityItem = new EntityItem(getWorldObj(), x, y, z, stack.copy());//
|
||||
EntityItem entityItem = new EntityItem(this.getWorldObj(), x, y, z, stack.copy());//
|
||||
|
||||
entityItem.motionX = side.offsetX*0.1;
|
||||
entityItem.motionY = side.offsetY*0.1;
|
||||
@@ -116,33 +116,33 @@ public class TileArcaneDropper extends TileEntity implements IInventory, ISidedI
|
||||
entityItem.delayBeforeCanPickup = 3;
|
||||
|
||||
//prevent stackOverflows
|
||||
dropQueue.add(entityItem);
|
||||
this.dropQueue.add(entityItem);
|
||||
|
||||
return entityItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
updateInventory();
|
||||
return items.size();
|
||||
this.updateInventory();
|
||||
return this.items.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
updateInventory();
|
||||
this.updateInventory();
|
||||
|
||||
if(slot >= items.size()) return null; //Get rekt. nothing here on this slot.
|
||||
if(slot >= this.items.size()) return null; //Get rekt. nothing here on this slot.
|
||||
|
||||
EntityItem entity = items.get(slot);
|
||||
EntityItem entity = this.items.get(slot);
|
||||
return entity == null || entity.isDead ? null : entity.getEntityItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
ItemStack stack = this.getStackInSlot(slot);
|
||||
|
||||
if(stack.stackSize - amount <= 0) {
|
||||
setInventorySlotContents(slot, null);
|
||||
this.setInventorySlotContents(slot, null);
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
@@ -150,15 +150,15 @@ public class TileArcaneDropper extends TileEntity implements IInventory, ISidedI
|
||||
newStack.stackSize = amount;
|
||||
stack.stackSize -= amount;
|
||||
|
||||
removedEntity = items.get(slot);
|
||||
removedCount = amount;
|
||||
this.removedEntity = this.items.get(slot);
|
||||
this.removedCount = amount;
|
||||
|
||||
return newStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
EntityItem oldEntity = items.get(slot);
|
||||
EntityItem oldEntity = this.items.get(slot);
|
||||
|
||||
if(oldEntity != null) {
|
||||
oldEntity.setDead();
|
||||
@@ -169,7 +169,7 @@ public class TileArcaneDropper extends TileEntity implements IInventory, ISidedI
|
||||
oldEntity.getEntityItem().stackSize = stack.stackSize;
|
||||
oldEntity.isDead = false;
|
||||
} else {
|
||||
items.set(slot, dropItem(stack));
|
||||
this.items.set(slot, this.dropItem(stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public class TileArcaneDropper extends TileEntity implements IInventory, ISidedI
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
int[] slots = new int[getSizeInventory()];
|
||||
int[] slots = new int[this.getSizeInventory()];
|
||||
for(int i = 0; i < slots.length; i++) {
|
||||
slots[i] = i;
|
||||
}
|
||||
@@ -226,13 +226,13 @@ public class TileArcaneDropper extends TileEntity implements IInventory, ISidedI
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
return RegisteredBlocks.blockArcaneDropper
|
||||
.isSideSolid(getWorldObj(), this.xCoord, this.yCoord, this.zCoord, ForgeDirection.getOrientation(side));
|
||||
.isSideSolid(this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, ForgeDirection.getOrientation(side));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
if(canInsertItem(slot, stack, side)) {
|
||||
EntityItem entityItem = items.get(slot);
|
||||
if(this.canInsertItem(slot, stack, side)) {
|
||||
EntityItem entityItem = this.items.get(slot);
|
||||
return entityItem == null || entityItem.delayBeforeCanPickup <= 0;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -29,47 +29,47 @@ import java.util.UUID;
|
||||
* <p/>
|
||||
* Created by makeo @ 16.12.2015 11:50
|
||||
*/
|
||||
public class TileArcaneHand extends SynchronizedTileEntity implements IInventory, ISidedInventory {
|
||||
public class TileArcaneHand extends SynchronizedTileEntity implements ISidedInventory {
|
||||
private GuiFakePlayer fakePlayer;
|
||||
|
||||
private ItemInWorldManager im = null;
|
||||
private Container container = null;
|
||||
private List<Slot> slots = null;
|
||||
private ItemInWorldManager im;
|
||||
private Container container;
|
||||
private List<Slot> slots;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(im == null) {
|
||||
updateConnection();
|
||||
if(this.im == null) {
|
||||
this.updateConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateConnection() {
|
||||
container = null;
|
||||
slots = null;
|
||||
this.container = null;
|
||||
this.slots = null;
|
||||
|
||||
if (im == null) {
|
||||
im = new ItemInWorldManager(worldObj);
|
||||
if (this.im == null) {
|
||||
this.im = new ItemInWorldManager(this.worldObj);
|
||||
} else {
|
||||
im.setWorld((WorldServer) worldObj);
|
||||
this.im.setWorld((WorldServer) this.worldObj);
|
||||
}
|
||||
|
||||
TileEntity tile = getWorldObj().getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if (tile != null && worldObj instanceof WorldServer) {
|
||||
if(fakePlayer == null) {
|
||||
fakePlayer = new GuiFakePlayer(this);
|
||||
TileEntity tile = this.getWorldObj().getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if (tile != null && this.worldObj instanceof WorldServer) {
|
||||
if(this.fakePlayer == null) {
|
||||
this.fakePlayer = new GuiFakePlayer(this);
|
||||
}
|
||||
|
||||
fakePlayer.posX = xCoord;
|
||||
fakePlayer.posY = yCoord;
|
||||
fakePlayer.posZ = zCoord;
|
||||
this.fakePlayer.posX = this.xCoord;
|
||||
this.fakePlayer.posY = this.yCoord;
|
||||
this.fakePlayer.posZ = this.zCoord;
|
||||
|
||||
this.im.activateBlockOrUseItem(fakePlayer, worldObj, null, xCoord, yCoord - 1, zCoord, ForgeDirection.UP.ordinal(), 0.5F, 0.5F, 0.5F);
|
||||
this.im.activateBlockOrUseItem(this.fakePlayer, this.worldObj, null, this.xCoord, this.yCoord - 1, this.zCoord, ForgeDirection.UP.ordinal(), 0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
if(container == null) {
|
||||
if(this.container == null) {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@@ -82,12 +82,12 @@ public class TileArcaneHand extends SynchronizedTileEntity implements IInventory
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
return slots.get(slot).isItemValid(stack);
|
||||
return this.slots.get(slot).isItemValid(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
return slots.get(slot).canTakeStack(fakePlayer);
|
||||
return this.slots.get(slot).canTakeStack(this.fakePlayer);
|
||||
}
|
||||
|
||||
private static class GuiFakePlayer extends AdvancedFakePlayer {
|
||||
@@ -100,12 +100,12 @@ public class TileArcaneHand extends SynchronizedTileEntity implements IInventory
|
||||
|
||||
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) {
|
||||
ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod);
|
||||
tile.container = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, this, modGuiId, world, x, y, z);
|
||||
if (tile.container != null) {
|
||||
tile.slots = new ArrayList<Slot>();
|
||||
for (Slot slot : (List<Slot>) tile.container.inventorySlots) {
|
||||
if(!inventory.equals(slot.inventory)) {
|
||||
tile.slots.add(slot);
|
||||
this.tile.container = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, this, modGuiId, world, x, y, z);
|
||||
if (this.tile.container != null) {
|
||||
this.tile.slots = new ArrayList<Slot>();
|
||||
for (Slot slot : (List<Slot>) this.tile.container.inventorySlots) {
|
||||
if(!this.inventory.equals(slot.inventory)) {
|
||||
this.tile.slots.add(slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,17 +124,17 @@ public class TileArcaneHand extends SynchronizedTileEntity implements IInventory
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.size();
|
||||
return this.slots.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
return slots.get(slot).getStack();
|
||||
return this.slots.get(slot).getStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
Slot s = slots.get(slot);
|
||||
Slot s = this.slots.get(slot);
|
||||
|
||||
if (s.getStack() != null) {
|
||||
ItemStack itemstack;
|
||||
@@ -164,7 +164,7 @@ public class TileArcaneHand extends SynchronizedTileEntity implements IInventory
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
slots.get(slot).putStack(stack);
|
||||
this.slots.get(slot).putStack(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,38 +25,38 @@ import java.util.List;
|
||||
* <p/>
|
||||
* Created by makeo @ 14.11.2015 12:22
|
||||
*/
|
||||
public class TileArcanePackager extends TileJarFillable implements IInventory, ISidedInventory {
|
||||
public class TileArcanePackager extends TileJarFillable implements ISidedInventory {
|
||||
private static final Aspect ASPECT = Aspect.CLOTH;
|
||||
|
||||
private ItemStack[] contents = new ItemStack[12];
|
||||
|
||||
//0 - 46
|
||||
public byte progress = -1;
|
||||
public boolean autoStart = false;
|
||||
public boolean useEssentia = false;
|
||||
public boolean disguise = false;
|
||||
private Boolean redstoneState = null;
|
||||
public boolean autoStart;
|
||||
public boolean useEssentia;
|
||||
public boolean disguise;
|
||||
private Boolean redstoneState;
|
||||
|
||||
private int count = 0;
|
||||
private int count;
|
||||
|
||||
public TileArcanePackager() {
|
||||
aspectFilter = ASPECT;
|
||||
maxAmount = 8;
|
||||
this.aspectFilter = TileArcanePackager.ASPECT;
|
||||
this.maxAmount = 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
|
||||
contents = new ItemStack[getSizeInventory()];
|
||||
this.contents = new ItemStack[this.getSizeInventory()];
|
||||
NBTTagList list = compound.getTagList("Items", 10);
|
||||
|
||||
for (int i = 0; i < list.tagCount(); ++i) {
|
||||
NBTTagCompound slot = list.getCompoundTagAt(i);
|
||||
int j = slot.getByte("Slot") & 255;
|
||||
|
||||
if (j >= 0 && j < contents.length) {
|
||||
contents[j] = ItemStack.loadItemStackFromNBT(slot);
|
||||
if (j >= 0 && j < this.contents.length) {
|
||||
this.contents[j] = ItemStack.loadItemStackFromNBT(slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,11 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
super.writeToNBT(compound);
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (int i = 0; i < contents.length; ++i) {
|
||||
if (contents[i] != null) {
|
||||
for (int i = 0; i < this.contents.length; ++i) {
|
||||
if (this.contents[i] != null) {
|
||||
NBTTagCompound slot = new NBTTagCompound();
|
||||
slot.setByte("Slot", (byte) i);
|
||||
contents[i].writeToNBT(slot);
|
||||
this.contents[i].writeToNBT(slot);
|
||||
list.appendTag(slot);
|
||||
}
|
||||
}
|
||||
@@ -80,51 +80,51 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (worldObj.isRemote) {
|
||||
if (progress >= 0 && progress < 46) {
|
||||
progress++;
|
||||
if (this.worldObj.isRemote) {
|
||||
if (this.progress >= 0 && this.progress < 46) {
|
||||
this.progress++;
|
||||
}
|
||||
} else {
|
||||
if (redstoneState == null) {
|
||||
redstoneState = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
||||
if (this.redstoneState == null) {
|
||||
this.redstoneState = this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
if (progress >= 47) {
|
||||
doPack();
|
||||
progress = -1;
|
||||
markForUpdate();
|
||||
count = 1;
|
||||
if (this.progress >= 47) {
|
||||
this.doPack();
|
||||
this.progress = -1;
|
||||
this.markForUpdate();
|
||||
this.count = 1;
|
||||
}
|
||||
|
||||
if (progress >= 0) {
|
||||
progress++;
|
||||
} else if (count++ % 5 == 0) {
|
||||
if (autoStart && canPack()) {
|
||||
progress = 0;
|
||||
markForUpdate();
|
||||
if (this.progress >= 0) {
|
||||
this.progress++;
|
||||
} else if (this.count++ % 5 == 0) {
|
||||
if (this.autoStart && this.canPack()) {
|
||||
this.progress = 0;
|
||||
this.markForUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateRedstone(boolean state) {
|
||||
if(redstoneState != null && state && !redstoneState) {
|
||||
if (canPack()) {
|
||||
progress = 0;
|
||||
markForUpdate();
|
||||
if(this.redstoneState != null && state && !this.redstoneState) {
|
||||
if (this.canPack()) {
|
||||
this.progress = 0;
|
||||
this.markForUpdate();
|
||||
}
|
||||
}
|
||||
redstoneState = state;
|
||||
this.redstoneState = state;
|
||||
}
|
||||
|
||||
private boolean canPack() {
|
||||
if (getStackInSlot(11) != null) {
|
||||
if (this.getStackInSlot(11) != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean check = false;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (getStackInSlot(i) != null) {
|
||||
if (this.getStackInSlot(i) != null) {
|
||||
check = true;
|
||||
break;
|
||||
}
|
||||
@@ -134,65 +134,60 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
return false;
|
||||
}
|
||||
|
||||
if (useEssentia) {
|
||||
if (amount < 4) {
|
||||
return false;
|
||||
}
|
||||
if (this.useEssentia) {
|
||||
return this.amount >= 4;
|
||||
} else {
|
||||
ItemStack leather = getStackInSlot(9);
|
||||
ItemStack leather = this.getStackInSlot(9);
|
||||
if (leather == null || leather.stackSize < 1 || leather.getItem() != Items.leather) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack string = getStackInSlot(10);
|
||||
if (string == null || string.stackSize < 1 || string.getItem() != Items.string) {
|
||||
return false;
|
||||
}
|
||||
ItemStack string = this.getStackInSlot(10);
|
||||
return string != null && string.stackSize >= 1 && string.getItem() == Items.string;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void doPack() {
|
||||
if (canPack()) {
|
||||
if (this.canPack()) {
|
||||
List<ItemStack> contents = new ArrayList<ItemStack>();
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack stack = getStackInSlot(i);
|
||||
ItemStack stack = this.getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
contents.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack pack = new ItemStack(disguise ? RegisteredItems.itemFakeLootbag : RegisteredItems.itemPackage, 1, useEssentia ? 1 : 0);
|
||||
ItemStack pack = new ItemStack(this.disguise ? RegisteredItems.itemFakeLootbag : RegisteredItems.itemPackage, 1, this.useEssentia ? 1 : 0);
|
||||
boolean success = RegisteredItems.itemPackage.setContents(pack, contents);
|
||||
|
||||
if (success) {
|
||||
if (useEssentia) {
|
||||
amount -= 4;
|
||||
if (this.useEssentia) {
|
||||
this.amount -= 4;
|
||||
} else {
|
||||
decrStackSize(9, 1);
|
||||
decrStackSize(10, 1);
|
||||
this.decrStackSize(9, 1);
|
||||
this.decrStackSize(10, 1);
|
||||
}
|
||||
setInventorySlotContents(11, pack);
|
||||
this.setInventorySlotContents(11, pack);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
setInventorySlotContents(i, null);
|
||||
this.setInventorySlotContents(i, null);
|
||||
}
|
||||
} else {
|
||||
worldObj.newExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 1, false, false);
|
||||
this.worldObj.newExplosion(null, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, 1, false, false);
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack stack = this.contents[i];
|
||||
if(stack != null) {
|
||||
EntityItem entityItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + (13/16f), zCoord + 0.5, stack);
|
||||
ItemUtils.applyRandomDropOffset(entityItem, worldObj.rand);
|
||||
worldObj.spawnEntityInWorld(entityItem);
|
||||
EntityItem entityItem = new EntityItem(this.worldObj, this.xCoord + 0.5, this.yCoord + (13/16f), this.zCoord + 0.5, stack);
|
||||
ItemUtils.applyRandomDropOffset(entityItem, this.worldObj.rand);
|
||||
this.worldObj.spawnEntityInWorld(entityItem);
|
||||
this.contents[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
progress = -1;
|
||||
markForUpdate();
|
||||
this.progress = -1;
|
||||
this.markForUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,14 +195,14 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound compound) {
|
||||
super.readCustomNBT(compound);
|
||||
aspectFilter = ASPECT;
|
||||
this.aspectFilter = TileArcanePackager.ASPECT;
|
||||
|
||||
progress = compound.getByte("progress");
|
||||
this.progress = compound.getByte("progress");
|
||||
|
||||
byte settings = compound.getByte("settings");
|
||||
autoStart = (settings & 1) == 1;
|
||||
useEssentia = (settings & 2) == 2;
|
||||
disguise = (settings & 4) == 4;
|
||||
this.autoStart = (settings & 1) == 1;
|
||||
this.useEssentia = (settings & 2) == 2;
|
||||
this.disguise = (settings & 4) == 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,17 +210,17 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
super.writeCustomNBT(compound);
|
||||
compound.removeTag("AspectFilter");
|
||||
|
||||
compound.setByte("progress", progress);
|
||||
compound.setByte("progress", this.progress);
|
||||
|
||||
byte settings = (byte) (autoStart ? 1 : 0);
|
||||
settings |= useEssentia ? 2 : 0;
|
||||
settings |= disguise ? 4 : 0;
|
||||
byte settings = (byte) (this.autoStart ? 1 : 0);
|
||||
settings |= this.useEssentia ? 2 : 0;
|
||||
settings |= this.disguise ? 4 : 0;
|
||||
compound.setByte("settings", settings);
|
||||
}
|
||||
|
||||
public void markForUpdate() {
|
||||
markDirty();
|
||||
getWorldObj().markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.markDirty();
|
||||
this.getWorldObj().markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -235,7 +230,7 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
return contents[slot];
|
||||
return this.contents[slot];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -321,13 +316,10 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
return stack.getItem() == Items.leather;
|
||||
} else if (slot == 10) {
|
||||
return stack.getItem() == Items.string;
|
||||
} else if (slot == 11) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else return slot != 11;
|
||||
}
|
||||
|
||||
private static final int[] ORIENTATION_MAPPING = new int[]{-1, -1, 0, 2, 1, 3};
|
||||
private static final int[] ORIENTATION_MAPPING = {-1, -1, 0, 2, 1, 3};
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
@@ -335,7 +327,7 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
return new int[]{11};
|
||||
}
|
||||
|
||||
if (ORIENTATION_MAPPING[side] == super.facing) {
|
||||
if (TileArcanePackager.ORIENTATION_MAPPING[side] == super.facing) {
|
||||
return new int[]{9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
}
|
||||
|
||||
@@ -344,7 +336,7 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
return !(useEssentia && (slot == 9 || slot == 10));
|
||||
return !(this.useEssentia && (slot == 9 || slot == 10));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,8 +2,8 @@ package makeo.gadomancy.common.blocks.tiles;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import makeo.gadomancy.common.entities.EntityPermNoClipItem;
|
||||
import makeo.gadomancy.common.aura.AuraEffectHandler;
|
||||
import makeo.gadomancy.common.entities.EntityPermNoClipItem;
|
||||
import makeo.gadomancy.common.utils.NBTHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
@@ -39,14 +39,14 @@ import java.util.List;
|
||||
*/
|
||||
public class TileAuraPylon extends SynchronizedTileEntity implements IAspectContainer, IEssentiaTransport, EntityPermNoClipItem.IItemMasterTile {
|
||||
|
||||
private ItemStack crystalEssentiaStack = null;
|
||||
private boolean isPartOfMultiblock = false;
|
||||
private ItemStack crystalEssentiaStack;
|
||||
private boolean isPartOfMultiblock;
|
||||
|
||||
private int timeSinceLastItemInfo = 0;
|
||||
private int timeSinceLastItemInfo;
|
||||
|
||||
private int ticksExisted = 0;
|
||||
private int ticksExisted;
|
||||
private Aspect holdingAspect;
|
||||
private int amount = 0;
|
||||
private int amount;
|
||||
private int maxAmount = 5;
|
||||
private boolean isMasterTile;
|
||||
private boolean isInputTile;
|
||||
@@ -54,47 +54,47 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ticksExisted++;
|
||||
timeSinceLastItemInfo++;
|
||||
this.ticksExisted++;
|
||||
this.timeSinceLastItemInfo++;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if ((ticksExisted & 3) == 0) {
|
||||
if (checkComponents()) return;
|
||||
if (!this.worldObj.isRemote) {
|
||||
if ((this.ticksExisted & 3) == 0) {
|
||||
if (this.checkComponents()) return;
|
||||
}
|
||||
|
||||
if (isInputTile()) {
|
||||
handleIO();
|
||||
if (this.isInputTile()) {
|
||||
this.handleIO();
|
||||
}
|
||||
|
||||
if (isMasterTile()) {
|
||||
TileAuraPylon io = getInputTile();
|
||||
if (this.isMasterTile()) {
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
if(io != null && io.amount > 0) {
|
||||
if ((ticksExisted & 31) == 0) {
|
||||
drainEssentia(io);
|
||||
if ((this.ticksExisted & 31) == 0) {
|
||||
this.drainEssentia(io);
|
||||
}
|
||||
doAuraEffects(holdingAspect);
|
||||
this.doAuraEffects(this.holdingAspect);
|
||||
}
|
||||
if(holdingAspect != null && timeSinceLastItemInfo > 8) {
|
||||
informItemRemoval();
|
||||
if(this.holdingAspect != null && this.timeSinceLastItemInfo > 8) {
|
||||
this.informItemRemoval();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if(isInputTile() && holdingAspect != null) {
|
||||
doEssentiaTrail();
|
||||
if(this.isInputTile() && this.holdingAspect != null) {
|
||||
this.doEssentiaTrail();
|
||||
}
|
||||
}
|
||||
|
||||
if (isMasterTile()) {
|
||||
if (crystalEssentiaStack == null) {
|
||||
tryVortexPossibleItems();
|
||||
if (this.isMasterTile()) {
|
||||
if (this.crystalEssentiaStack == null) {
|
||||
this.tryVortexPossibleItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStillHoldItem() {
|
||||
return isMasterTile();
|
||||
return this.isMasterTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,25 +104,25 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
|
||||
private void doAuraEffects(Aspect aspect) {
|
||||
if(aspect == null) return;
|
||||
if(!isMasterTile()) return;
|
||||
if(worldObj.isRemote) return;
|
||||
AuraEffectHandler.distributeEffects(aspect, worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, ticksExisted);
|
||||
if(!this.isMasterTile()) return;
|
||||
if(this.worldObj.isRemote) return;
|
||||
AuraEffectHandler.distributeEffects(aspect, this.worldObj, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, this.ticksExisted);
|
||||
}
|
||||
|
||||
private void drainEssentia(TileAuraPylon io) {
|
||||
if(!isMasterTile()) return;
|
||||
if(!this.isMasterTile()) return;
|
||||
io.amount--;
|
||||
worldObj.markBlockForUpdate(io.xCoord, io.yCoord, io.zCoord);
|
||||
this.worldObj.markBlockForUpdate(io.xCoord, io.yCoord, io.zCoord);
|
||||
io.markDirty();
|
||||
}
|
||||
|
||||
//Client-Side input tile only!
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void doEssentiaTrail() {
|
||||
if((ticksExisted & 1) == 0) return;
|
||||
TileAuraPylon tile = getMasterTile();
|
||||
if((this.ticksExisted & 1) == 0) return;
|
||||
TileAuraPylon tile = this.getMasterTile();
|
||||
if(tile == null) return;
|
||||
TileAuraPylon inputTile = getInputTile();
|
||||
TileAuraPylon inputTile = this.getInputTile();
|
||||
if(inputTile == null) return;
|
||||
Aspect a = inputTile.getAspectType();
|
||||
if(a == null) return;
|
||||
@@ -132,35 +132,35 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
FXEssentiaTrail essentiaTrail = new FXEssentiaTrail(tile.getWorldObj(), inputTile.xCoord + 0.5, inputTile.yCoord + 0.2, inputTile.zCoord + 0.5, tile.xCoord + 0.5, tile.yCoord + 1.7, tile.zCoord + 0.5, count, a.getColor(), 1);
|
||||
essentiaTrail.noClip = true;
|
||||
essentiaTrail.motionY = (0.1F + MathHelper.sin(count / 3.0F) * 0.01F);
|
||||
essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.001F + worldObj.rand.nextGaussian() * 0.002000000094994903D);
|
||||
essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.001F + worldObj.rand.nextGaussian() * 0.002000000094994903D);
|
||||
essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.001F + this.worldObj.rand.nextGaussian() * 0.002000000094994903D);
|
||||
essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.001F + this.worldObj.rand.nextGaussian() * 0.002000000094994903D);
|
||||
ParticleEngine.instance.addEffect(tile.getWorldObj(), essentiaTrail);
|
||||
}
|
||||
|
||||
//Special to masterTile only!
|
||||
private void distributeAspectInformation() {
|
||||
if(!isMasterTile()) return;
|
||||
if(!this.isMasterTile()) return;
|
||||
int count = 1;
|
||||
TileEntity iter = worldObj.getTileEntity(xCoord, yCoord - count, zCoord);
|
||||
TileEntity iter = this.worldObj.getTileEntity(this.xCoord, this.yCoord - count, this.zCoord);
|
||||
while(iter != null && iter instanceof TileAuraPylon) {
|
||||
((TileAuraPylon) iter).holdingAspect = holdingAspect;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord - count, zCoord);
|
||||
((TileAuraPylon) iter).holdingAspect = this.holdingAspect;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord - count, this.zCoord);
|
||||
iter.markDirty();
|
||||
count++;
|
||||
iter = worldObj.getTileEntity(xCoord, yCoord - count, zCoord);
|
||||
iter = this.worldObj.getTileEntity(this.xCoord, this.yCoord - count, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
//Special to masterTile only!
|
||||
private void tryVortexPossibleItems() {
|
||||
TileAuraPylon io = getInputTile();
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
if (io == null) return;
|
||||
|
||||
int masterY = yCoord + 1;
|
||||
int masterY = this.yCoord + 1;
|
||||
float dst = ((float) (masterY - io.yCoord)) / 2F;
|
||||
float yC = masterY - dst;
|
||||
List entityItems = worldObj.selectEntitiesWithinAABB(EntityItem.class,
|
||||
AxisAlignedBB.getBoundingBox(xCoord - 0.5, yC - 0.5, zCoord - 0.5, xCoord + 0.5, yC + 0.5, zCoord + 0.5).expand(8, 8, 8), new IEntitySelector() {
|
||||
List entityItems = this.worldObj.selectEntitiesWithinAABB(EntityItem.class,
|
||||
AxisAlignedBB.getBoundingBox(this.xCoord - 0.5, yC - 0.5, this.zCoord - 0.5, this.xCoord + 0.5, yC + 0.5, this.zCoord + 0.5).expand(8, 8, 8), new IEntitySelector() {
|
||||
@Override
|
||||
public boolean isEntityApplicable(Entity e) {
|
||||
return !(e instanceof EntityPermanentItem) && !(e instanceof EntitySpecialItem) &&
|
||||
@@ -169,10 +169,10 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
((ItemCrystalEssence) ((EntityItem) e).getEntityItem().getItem()).getAspects(((EntityItem) e).getEntityItem()) != null;
|
||||
}
|
||||
});
|
||||
Entity dummy = new EntityItem(worldObj);
|
||||
dummy.posX = xCoord + 0.5;
|
||||
Entity dummy = new EntityItem(this.worldObj);
|
||||
dummy.posX = this.xCoord + 0.5;
|
||||
dummy.posY = yC + 0.5;
|
||||
dummy.posZ = zCoord + 0.5;
|
||||
dummy.posZ = this.zCoord + 0.5;
|
||||
|
||||
//MC code.
|
||||
EntityItem entity = null;
|
||||
@@ -188,13 +188,13 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
}
|
||||
}
|
||||
if(entity == null) return;
|
||||
if(dummy.getDistanceToEntity(entity) < 1 && !worldObj.isRemote) {
|
||||
if(dummy.getDistanceToEntity(entity) < 1 && !this.worldObj.isRemote) {
|
||||
ItemStack inter = entity.getEntityItem();
|
||||
inter.stackSize--;
|
||||
this.crystalEssentiaStack = inter.copy();
|
||||
this.crystalEssentiaStack.stackSize = 1;
|
||||
|
||||
EntityPermNoClipItem item = new EntityPermNoClipItem(entity.worldObj, xCoord + 0.5F, yC + 0.3F, zCoord + 0.5F, crystalEssentiaStack, xCoord, yCoord, zCoord);
|
||||
EntityPermNoClipItem item = new EntityPermNoClipItem(entity.worldObj, this.xCoord + 0.5F, yC + 0.3F, this.zCoord + 0.5F, this.crystalEssentiaStack, this.xCoord, this.yCoord, this.zCoord);
|
||||
entity.worldObj.spawnEntityInWorld(item);
|
||||
item.motionX = 0;
|
||||
item.motionY = 0;
|
||||
@@ -203,19 +203,19 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
item.age = entity.age;
|
||||
item.noClip = true;
|
||||
|
||||
timeSinceLastItemInfo = 0;
|
||||
this.timeSinceLastItemInfo = 0;
|
||||
|
||||
holdingAspect = ((ItemCrystalEssence) crystalEssentiaStack.getItem()).getAspects(crystalEssentiaStack).getAspects()[0];
|
||||
distributeAspectInformation();
|
||||
this.holdingAspect = ((ItemCrystalEssence) this.crystalEssentiaStack.getItem()).getAspects(this.crystalEssentiaStack).getAspects()[0];
|
||||
this.distributeAspectInformation();
|
||||
|
||||
if(inter.stackSize <= 0) entity.setDead();
|
||||
entity.noClip = false;
|
||||
item.delayBeforeCanPickup = 60;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
} else {
|
||||
entity.noClip = true;
|
||||
applyMovementVectors(entity);
|
||||
this.applyMovementVectors(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
|
||||
//Special to inputTile only!
|
||||
private void handleIO() {
|
||||
if ((!worldObj.isRemote) && ((ticksExisted & 15) == 0) && (getEssentiaAmount() < getMaxAmount())) {
|
||||
if ((!this.worldObj.isRemote) && ((this.ticksExisted & 15) == 0) && (this.getEssentiaAmount() < this.getMaxAmount())) {
|
||||
TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN);
|
||||
if (te != null) {
|
||||
IEssentiaTransport ic = (IEssentiaTransport) te;
|
||||
@@ -244,8 +244,8 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
return;
|
||||
}
|
||||
|
||||
if ((holdingAspect != null) && (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN))) {
|
||||
addToContainer(holdingAspect, ic.takeEssentia(holdingAspect, 1, ForgeDirection.UP));
|
||||
if ((this.holdingAspect != null) && (ic.getSuctionAmount(ForgeDirection.UP) < this.getSuctionAmount(ForgeDirection.DOWN))) {
|
||||
this.addToContainer(this.holdingAspect, ic.takeEssentia(this.holdingAspect, 1, ForgeDirection.UP));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,16 +253,16 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
|
||||
@Override
|
||||
public void informItemRemoval() {
|
||||
if(!isMasterTile()) return;
|
||||
if(!this.isMasterTile()) return;
|
||||
this.crystalEssentiaStack = null;
|
||||
this.holdingAspect = null;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
distributeAspectInformation();
|
||||
TileAuraPylon io = getInputTile();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
this.distributeAspectInformation();
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
if(io == null) return;
|
||||
io.amount = 0;
|
||||
worldObj.markBlockForUpdate(io.xCoord, io.yCoord, io.zCoord);
|
||||
this.worldObj.markBlockForUpdate(io.xCoord, io.yCoord, io.zCoord);
|
||||
io.markDirty();
|
||||
}
|
||||
|
||||
@@ -280,52 +280,52 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
//Returns true, if state has changed, false if still complete state.
|
||||
private boolean checkComponents() {
|
||||
TileAuraPylon te = getMasterTile();
|
||||
TileAuraPylon te = this.getMasterTile();
|
||||
if (te == null) {
|
||||
breakTile();
|
||||
this.breakTile();
|
||||
return true;
|
||||
}
|
||||
te = getInputTile();
|
||||
te = this.getInputTile();
|
||||
if (te == null) {
|
||||
breakTile();
|
||||
this.breakTile();
|
||||
return true;
|
||||
}
|
||||
if(!hasTopTile()) {
|
||||
breakTile();
|
||||
if(!this.hasTopTile()) {
|
||||
this.breakTile();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean hasTopTile() {
|
||||
TileAuraPylon master = getMasterTile();
|
||||
TileAuraPylon master = this.getMasterTile();
|
||||
if(master == null) return false;
|
||||
TileEntity te = worldObj.getTileEntity(master.xCoord, master.yCoord + 1, master.zCoord);
|
||||
TileEntity te = this.worldObj.getTileEntity(master.xCoord, master.yCoord + 1, master.zCoord);
|
||||
return !(te == null || !(te instanceof TileAuraPylonTop));
|
||||
}
|
||||
|
||||
//Individual.
|
||||
private void breakTile() {
|
||||
if(!isPartOfMultiblock || worldObj.isRemote) return;
|
||||
if(!this.isPartOfMultiblock || this.worldObj.isRemote) return;
|
||||
|
||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
Block pylon = worldObj.getBlock(xCoord, yCoord, zCoord);
|
||||
int meta = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
Block pylon = this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord);
|
||||
if(pylon != null) {
|
||||
ArrayList<ItemStack> stacks = pylon.getDrops(worldObj, xCoord, yCoord, zCoord, meta, 0);
|
||||
ArrayList<ItemStack> stacks = pylon.getDrops(this.worldObj, this.xCoord, this.yCoord, this.zCoord, meta, 0);
|
||||
for(ItemStack i : stacks) {
|
||||
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, i);
|
||||
EntityItem item = new EntityItem(this.worldObj, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, i);
|
||||
//ItemUtils.applyRandomDropOffset(item, worldObj.rand);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
this.worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
//Individual
|
||||
public boolean isPartOfMultiblock() {
|
||||
return isPartOfMultiblock;
|
||||
return this.isPartOfMultiblock;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@@ -347,57 +347,57 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
|
||||
//Individual.
|
||||
public boolean isInputTile() {
|
||||
return isInputTile;
|
||||
return this.isInputTile;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
public TileAuraPylon getInputTile() {
|
||||
if (isInputTile()) return this;
|
||||
if(worldObj == null) return null;
|
||||
TileEntity superTile = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if (this.isInputTile()) return this;
|
||||
if(this.worldObj == null) return null;
|
||||
TileEntity superTile = this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if (superTile == null || !(superTile instanceof TileAuraPylon)) return null;
|
||||
return ((TileAuraPylon) superTile).getInputTile();
|
||||
}
|
||||
|
||||
//Individual.
|
||||
public boolean isMasterTile() {
|
||||
return isMasterTile;
|
||||
return this.isMasterTile;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
public TileAuraPylon getMasterTile() {
|
||||
if (isMasterTile()) return this;
|
||||
if(worldObj == null) return null;
|
||||
TileEntity superTile = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
if (this.isMasterTile()) return this;
|
||||
if(this.worldObj == null) return null;
|
||||
TileEntity superTile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
if (superTile == null || !(superTile instanceof TileAuraPylon)) return null;
|
||||
return ((TileAuraPylon) superTile).getMasterTile();
|
||||
}
|
||||
|
||||
//Dynamic.
|
||||
public int getEssentiaAmount() {
|
||||
TileAuraPylon io = getInputTile();
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
if (io == null) return 0;
|
||||
return io.amount;
|
||||
}
|
||||
|
||||
//Dynamic.
|
||||
public Aspect getAspectType() {
|
||||
TileAuraPylon io = getInputTile();
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
if (io == null) return null;
|
||||
return io.holdingAspect;
|
||||
}
|
||||
|
||||
//Dynamic.
|
||||
public int getMaxAmount() {
|
||||
TileAuraPylon io = getInputTile();
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
if (io == null) return 0;
|
||||
int max = io.maxAmount;
|
||||
int counter = 1;
|
||||
TileEntity superTile = worldObj.getTileEntity(xCoord, yCoord + counter, zCoord);
|
||||
TileEntity superTile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + counter, this.zCoord);
|
||||
while (superTile != null && superTile instanceof TileAuraPylon) {
|
||||
max += ((TileAuraPylon) superTile).maxAmount;
|
||||
counter++;
|
||||
superTile = worldObj.getTileEntity(xCoord, yCoord + counter, zCoord);
|
||||
superTile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + counter, this.zCoord);
|
||||
}
|
||||
return max;
|
||||
}
|
||||
@@ -421,16 +421,16 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound compound) {
|
||||
compound.setBoolean("input", isInputTile);
|
||||
compound.setBoolean("master", isMasterTile);
|
||||
if (holdingAspect != null) {
|
||||
compound.setString("aspect", holdingAspect.getTag());
|
||||
compound.setBoolean("input", this.isInputTile);
|
||||
compound.setBoolean("master", this.isMasterTile);
|
||||
if (this.holdingAspect != null) {
|
||||
compound.setString("aspect", this.holdingAspect.getTag());
|
||||
}
|
||||
compound.setInteger("amount", amount);
|
||||
compound.setInteger("maxAmount", maxAmount);
|
||||
compound.setBoolean("partOfMultiblock", isPartOfMultiblock);
|
||||
if(crystalEssentiaStack != null)
|
||||
NBTHelper.setStack(compound, "crystalStack", crystalEssentiaStack);
|
||||
compound.setInteger("amount", this.amount);
|
||||
compound.setInteger("maxAmount", this.maxAmount);
|
||||
compound.setBoolean("partOfMultiblock", this.isPartOfMultiblock);
|
||||
if(this.crystalEssentiaStack != null)
|
||||
NBTHelper.setStack(compound, "crystalStack", this.crystalEssentiaStack);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -440,7 +440,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Dynamic.
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
TileAuraPylon io = getInputTile();
|
||||
TileAuraPylon io = this.getInputTile();
|
||||
AspectList al = new AspectList();
|
||||
if (io != null && io.holdingAspect != null && io.amount > 0) {
|
||||
al.add(io.holdingAspect, io.amount);
|
||||
@@ -456,7 +456,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
@Override
|
||||
public boolean doesContainerAccept(Aspect aspect) {
|
||||
return isInputTile() && holdingAspect != null && holdingAspect.equals(aspect);
|
||||
return this.isInputTile() && this.holdingAspect != null && this.holdingAspect.equals(aspect);
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@@ -466,15 +466,15 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
return amount;
|
||||
}
|
||||
|
||||
if (!isInputTile()) return 0;
|
||||
if (!this.isInputTile()) return 0;
|
||||
if (aspect == null) return 0;
|
||||
|
||||
if (holdingAspect != null && this.amount < getMaxAmount() && aspect == holdingAspect) {
|
||||
int added = Math.min(amount, getMaxAmount() - this.amount);
|
||||
if (this.holdingAspect != null && this.amount < this.getMaxAmount() && aspect == this.holdingAspect) {
|
||||
int added = Math.min(amount, this.getMaxAmount() - this.amount);
|
||||
this.amount += added;
|
||||
amount -= added;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
markDirty();
|
||||
this.markDirty();
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
@@ -482,17 +482,17 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
@Override
|
||||
public boolean takeFromContainer(Aspect aspect, int i) {
|
||||
if (!isInputTile()) return false;
|
||||
if (aspect == null || holdingAspect == null) return false;
|
||||
if (!this.isInputTile()) return false;
|
||||
if (aspect == null || this.holdingAspect == null) return false;
|
||||
|
||||
if (this.amount >= i && holdingAspect.equals(aspect)) {
|
||||
if (this.amount >= i && this.holdingAspect.equals(aspect)) {
|
||||
this.amount -= i;
|
||||
if (this.amount <= 0) {
|
||||
this.holdingAspect = null;
|
||||
this.amount = 0;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
markDirty();
|
||||
this.markDirty();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -508,16 +508,16 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(Aspect aspect, int i) {
|
||||
return isInputTile() && holdingAspect != null && this.amount >= i && aspect == holdingAspect;
|
||||
return this.isInputTile() && this.holdingAspect != null && this.amount >= i && aspect == this.holdingAspect;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@Override
|
||||
public boolean doesContainerContain(AspectList list) {
|
||||
if (!isInputTile()) return false;
|
||||
if (holdingAspect == null) return false;
|
||||
if (!this.isInputTile()) return false;
|
||||
if (this.holdingAspect == null) return false;
|
||||
|
||||
for (Aspect a : list.getAspects()) if ((this.amount > 0) && (a == holdingAspect)) return true;
|
||||
for (Aspect a : list.getAspects()) if ((this.amount > 0) && (a == this.holdingAspect)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -534,13 +534,13 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
@Override
|
||||
public boolean isConnectable(ForgeDirection face) {
|
||||
return isInputTile() && face == ForgeDirection.DOWN;
|
||||
return this.isInputTile() && face == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@Override
|
||||
public boolean canInputFrom(ForgeDirection face) {
|
||||
return isInputTile() && face == ForgeDirection.DOWN;
|
||||
return this.isInputTile() && face == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@@ -557,14 +557,14 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
//Individual.
|
||||
@Override
|
||||
public Aspect getSuctionType(ForgeDirection forgeDirection) {
|
||||
return isInputTile() ? holdingAspect : null;
|
||||
return this.isInputTile() ? this.holdingAspect : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection forgeDirection) {
|
||||
if (!isInputTile()) return 0;
|
||||
if (holdingAspect == null) return 0;
|
||||
return getMinimumSuction();
|
||||
if (!this.isInputTile()) return 0;
|
||||
if (this.holdingAspect == null) return 0;
|
||||
return this.getMinimumSuction();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -574,20 +574,20 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
|
||||
@Override
|
||||
public int addEssentia(Aspect aspect, int amt, ForgeDirection direction) {
|
||||
if (!isInputTile()) return 0;
|
||||
return canInputFrom(direction) ? amount - addToContainer(aspect, amount) : 0;
|
||||
if (!this.isInputTile()) return 0;
|
||||
return this.canInputFrom(direction) ? this.amount - this.addToContainer(aspect, this.amount) : 0;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@Override
|
||||
public Aspect getEssentiaType(ForgeDirection forgeDirection) {
|
||||
return isInputTile() ? holdingAspect : null;
|
||||
return this.isInputTile() ? this.holdingAspect : null;
|
||||
}
|
||||
|
||||
//Individual.
|
||||
@Override
|
||||
public int getEssentiaAmount(ForgeDirection forgeDirection) {
|
||||
return isInputTile() ? amount : 0;
|
||||
return this.isInputTile() ? this.amount : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -602,8 +602,8 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
|
||||
}
|
||||
|
||||
public boolean isLowestTile() {
|
||||
if(worldObj == null) return false;
|
||||
TileEntity te = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if(this.worldObj == null) return false;
|
||||
TileEntity te = this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
return te == null || !(te instanceof TileAuraPylon);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,9 @@ package makeo.gadomancy.common.blocks.tiles;
|
||||
import makeo.gadomancy.client.effect.EffectHandler;
|
||||
import makeo.gadomancy.client.effect.fx.Orbital;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.utils.ItemUtils;
|
||||
import makeo.gadomancy.common.utils.Vector3;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -28,31 +24,31 @@ import java.util.ArrayList;
|
||||
public class TileAuraPylonTop extends SynchronizedTileEntity implements IAspectContainer {
|
||||
|
||||
public Orbital orbital;
|
||||
private boolean shouldRender = false;
|
||||
private boolean shouldRenderAura = false;
|
||||
private boolean shouldRender;
|
||||
private boolean shouldRenderAura;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
TileEntity te = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if(!worldObj.isRemote) {
|
||||
TileEntity te = this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if(!this.worldObj.isRemote) {
|
||||
if(te == null || !(te instanceof TileAuraPylon)) {
|
||||
breakTile();
|
||||
this.breakTile();
|
||||
return;
|
||||
}
|
||||
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) != RegisteredBlocks.blockAuraPylon || worldObj.getBlockMetadata(xCoord, yCoord - 1, zCoord) != 0) {
|
||||
breakTile();
|
||||
if(this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) != RegisteredBlocks.blockAuraPylon || this.worldObj.getBlockMetadata(this.xCoord, this.yCoord - 1, this.zCoord) != 0) {
|
||||
this.breakTile();
|
||||
return;
|
||||
}
|
||||
TileAuraPylon pylon = (TileAuraPylon) te;
|
||||
if(pylon.isPartOfMultiblock() && !pylon.isMasterTile()) breakTile();
|
||||
if(pylon.isPartOfMultiblock() && !pylon.isMasterTile()) this.breakTile();
|
||||
} else {
|
||||
shouldRender = te != null && te instanceof TileAuraPylon && ((TileAuraPylon) te).isPartOfMultiblock();
|
||||
shouldRenderAura = te != null && te instanceof TileAuraPylon && ((TileAuraPylon) te).getEssentiaAmount() > 0;
|
||||
this.shouldRender = te != null && te instanceof TileAuraPylon && ((TileAuraPylon) te).isPartOfMultiblock();
|
||||
this.shouldRenderAura = te != null && te instanceof TileAuraPylon && ((TileAuraPylon) te).getEssentiaAmount() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public Aspect getAspect() {
|
||||
TileEntity te = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
TileEntity te = this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if(te == null || !(te instanceof TileAuraPylon)) {
|
||||
return null;
|
||||
}
|
||||
@@ -60,35 +56,35 @@ public class TileAuraPylonTop extends SynchronizedTileEntity implements IAspectC
|
||||
}
|
||||
|
||||
private void breakTile() {
|
||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
Block pylon = worldObj.getBlock(xCoord, yCoord, zCoord);
|
||||
int meta = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
Block pylon = this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord);
|
||||
if(pylon != null) {
|
||||
ArrayList<ItemStack> stacks = pylon.getDrops(worldObj, xCoord, yCoord, zCoord, meta, 0);
|
||||
ArrayList<ItemStack> stacks = pylon.getDrops(this.worldObj, this.xCoord, this.yCoord, this.zCoord, meta, 0);
|
||||
for(ItemStack i : stacks) {
|
||||
EntityItem item = new EntityItem(worldObj, xCoord, yCoord, zCoord, i);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
EntityItem item = new EntityItem(this.worldObj, this.xCoord, this.yCoord, this.zCoord, i);
|
||||
this.worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public boolean shouldRenderEffect() {
|
||||
return shouldRender;
|
||||
return this.shouldRender;
|
||||
}
|
||||
|
||||
public boolean shouldRenderAuraEffect() {
|
||||
return shouldRenderAura;
|
||||
return this.shouldRenderAura;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
if(orbital != null) {
|
||||
orbital.clearOrbitals();
|
||||
if(orbital.registered)
|
||||
EffectHandler.getInstance().unregisterOrbital(orbital);
|
||||
if(this.orbital != null) {
|
||||
this.orbital.clearOrbitals();
|
||||
if(this.orbital.registered)
|
||||
EffectHandler.getInstance().unregisterOrbital(this.orbital);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +95,7 @@ public class TileAuraPylonTop extends SynchronizedTileEntity implements IAspectC
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
TileEntity master = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
TileEntity master = this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if(master == null || !(master instanceof TileAuraPylon)) return null;
|
||||
return ((TileAuraPylon) master).getAspects();
|
||||
}
|
||||
|
||||
@@ -33,45 +33,45 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
private static final int MAX_RANGE = 15;
|
||||
private static final Aspect ASPECT = Aspect.ORDER;
|
||||
|
||||
private int range = 0;
|
||||
private int saturation = 0;
|
||||
private int count = 0;
|
||||
private int range;
|
||||
private int saturation;
|
||||
private int count;
|
||||
|
||||
public TileBlockProtector() {
|
||||
maxAmount = 8;
|
||||
aspectFilter = ASPECT;
|
||||
this.maxAmount = 8;
|
||||
this.aspectFilter = TileBlockProtector.ASPECT;
|
||||
}
|
||||
|
||||
public int getCurrentRange() {
|
||||
return range;
|
||||
return this.range;
|
||||
}
|
||||
|
||||
public int getPowerLevel() {
|
||||
return Math.min(worldObj.getStrongestIndirectPower(xCoord, yCoord, zCoord), MAX_RANGE);
|
||||
return Math.min(this.worldObj.getStrongestIndirectPower(this.xCoord, this.yCoord, this.zCoord), TileBlockProtector.MAX_RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound) {
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("ProtectSaturation", saturation);
|
||||
compound.setInteger("ProtectSaturation", this.saturation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
saturation = compound.getInteger("ProtectSaturation");
|
||||
this.saturation = compound.getInteger("ProtectSaturation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound compound) {
|
||||
super.readCustomNBT(compound);
|
||||
aspectFilter = ASPECT;
|
||||
this.aspectFilter = TileBlockProtector.ASPECT;
|
||||
|
||||
int oldRange = range;
|
||||
range = compound.getInteger("ProtectRange");
|
||||
int oldRange = this.range;
|
||||
this.range = compound.getInteger("ProtectRange");
|
||||
|
||||
if(worldObj != null && worldObj.isRemote && oldRange != range) {
|
||||
worldObj.updateLightByType(EnumSkyBlock.Block, xCoord, yCoord, zCoord);
|
||||
if(this.worldObj != null && this.worldObj.isRemote && oldRange != this.range) {
|
||||
this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,57 +79,57 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
public void writeCustomNBT(NBTTagCompound compound) {
|
||||
super.writeCustomNBT(compound);
|
||||
compound.removeTag("AspectFilter");
|
||||
compound.setInteger("ProtectRange", range);
|
||||
compound.setInteger("ProtectRange", this.range);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!protectors.contains(this)) {
|
||||
protectors.add(this);
|
||||
if (!TileBlockProtector.protectors.contains(this)) {
|
||||
TileBlockProtector.protectors.add(this);
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (++count % 5 == 0 && amount < maxAmount) {
|
||||
fillJar();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (++this.count % 5 == 0 && this.amount < this.maxAmount) {
|
||||
this.fillJar();
|
||||
}
|
||||
|
||||
if (count % UPDATE_TICKS == 0) {
|
||||
if(range == 0) {
|
||||
saturation = 0;
|
||||
if (this.count % TileBlockProtector.UPDATE_TICKS == 0) {
|
||||
if(this.range == 0) {
|
||||
this.saturation = 0;
|
||||
}
|
||||
|
||||
if (saturation > 0) {
|
||||
saturation--;
|
||||
if (this.saturation > 0) {
|
||||
this.saturation--;
|
||||
return;
|
||||
}
|
||||
|
||||
int powerLevel = getPowerLevel();
|
||||
boolean executeDecrease = range > powerLevel;
|
||||
int powerLevel = this.getPowerLevel();
|
||||
boolean executeDecrease = this.range > powerLevel;
|
||||
|
||||
if(range <= powerLevel && powerLevel > 0) {
|
||||
if(this.range <= powerLevel && powerLevel > 0) {
|
||||
executeDecrease = true;
|
||||
if (takeFromContainer(ASPECT, 1)) {
|
||||
if (this.takeFromContainer(TileBlockProtector.ASPECT, 1)) {
|
||||
|
||||
if (range < powerLevel) {
|
||||
range++;
|
||||
markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
if (this.range < powerLevel) {
|
||||
this.range++;
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
saturation = 16 - range;
|
||||
this.saturation = 16 - this.range;
|
||||
}
|
||||
executeDecrease = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (executeDecrease && range > 0) {
|
||||
range--;
|
||||
if (executeDecrease && this.range > 0) {
|
||||
this.range--;
|
||||
|
||||
markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
} else if(range > 0) {
|
||||
float sizeMod = 1 - (range / 15f);
|
||||
} else if(this.range > 0) {
|
||||
float sizeMod = 1 - (this.range / 15f);
|
||||
if (this.worldObj.rand.nextInt(9 - Thaumcraft.proxy.particleCount(2)) == 0) {
|
||||
Thaumcraft.proxy.wispFX3(this.worldObj, this.xCoord + 0.5F, this.yCoord + 0.68F, this.zCoord + 0.5F, this.xCoord + 0.3F + this.worldObj.rand.nextFloat() * 0.4F, this.yCoord + 0.68F, this.zCoord + 0.3F + this.worldObj.rand.nextFloat() * 0.4F, 0.3F - (0.15f*sizeMod), 6, true, -0.025F);
|
||||
}
|
||||
@@ -138,14 +138,14 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
}
|
||||
}
|
||||
|
||||
if(range > 0) {
|
||||
for(EntityLivingBase entity : (List<EntityCreeper>)worldObj.getEntitiesWithinAABB(EntityLivingBase.class, getProtectedAABB())) {
|
||||
if(this.range > 0) {
|
||||
for(EntityLivingBase entity : (List<EntityCreeper>) this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.getProtectedAABB())) {
|
||||
if(entity instanceof EntityCreeper) {
|
||||
((EntityCreeper) entity).timeSinceIgnited = 0;
|
||||
}
|
||||
|
||||
if(worldObj.isRemote && !(entity instanceof EntityPlayer)) {
|
||||
spawnEntityParticles(entity);
|
||||
if(this.worldObj.isRemote && !(entity instanceof EntityPlayer)) {
|
||||
this.spawnEntityParticles(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,12 +153,12 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
|
||||
private void spawnEntityParticles(EntityLivingBase entity) {
|
||||
AxisAlignedBB cube = entity.boundingBox;
|
||||
if(cube != null && worldObj.rand.nextInt(20) == 0) {
|
||||
double posX = worldObj.rand.nextDouble() * (cube.maxX - cube.minX) + cube.minX;
|
||||
double posY = worldObj.rand.nextDouble() * (cube.maxX - cube.minX) + cube.minY;
|
||||
double posZ = worldObj.rand.nextDouble() * (cube.maxX - cube.minX) + cube.minZ;
|
||||
if(cube != null && this.worldObj.rand.nextInt(20) == 0) {
|
||||
double posX = this.worldObj.rand.nextDouble() * (cube.maxX - cube.minX) + cube.minX;
|
||||
double posY = this.worldObj.rand.nextDouble() * (cube.maxX - cube.minX) + cube.minY;
|
||||
double posZ = this.worldObj.rand.nextDouble() * (cube.maxX - cube.minX) + cube.minZ;
|
||||
|
||||
switch (worldObj.rand.nextInt(5)) {
|
||||
switch (this.worldObj.rand.nextInt(5)) {
|
||||
case 0: posX = cube.maxX; break;
|
||||
case 1: posY = cube.maxY; break;
|
||||
case 2: posZ = cube.maxZ; break;
|
||||
@@ -183,11 +183,11 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
} else if ((this.aspect != null) && (this.amount > 0)) {
|
||||
ta = this.aspect;
|
||||
} else if ((ic.getEssentiaAmount(ForgeDirection.UP) > 0) &&
|
||||
(ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN)) && (getSuctionAmount(ForgeDirection.DOWN) >= ic.getMinimumSuction())) {
|
||||
(ic.getSuctionAmount(ForgeDirection.UP) < this.getSuctionAmount(ForgeDirection.DOWN)) && (this.getSuctionAmount(ForgeDirection.DOWN) >= ic.getMinimumSuction())) {
|
||||
ta = ic.getEssentiaType(ForgeDirection.UP);
|
||||
}
|
||||
if ((ta != null) && (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN))) {
|
||||
addToContainer(ta, ic.takeEssentia(ta, 1, ForgeDirection.UP));
|
||||
if ((ta != null) && (ic.getSuctionAmount(ForgeDirection.UP) < this.getSuctionAmount(ForgeDirection.DOWN))) {
|
||||
this.addToContainer(ta, ic.takeEssentia(ta, 1, ForgeDirection.UP));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,28 +220,28 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
private static List<TileBlockProtector> protectors = new ArrayList<TileBlockProtector>();
|
||||
|
||||
public static boolean isSpotProtected(World world, final double x, final double y, final double z) {
|
||||
return isSpotProtected(world, new ProtectionHelper() {
|
||||
return TileBlockProtector.isSpotProtected(world, new ProtectionHelper() {
|
||||
@Override
|
||||
public boolean checkProtection(TileBlockProtector tile) {
|
||||
return isSpotProtected(tile, x, y, z);
|
||||
return TileBlockProtector.isSpotProtected(tile, x, y, z);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isSpotProtected(World world, final Entity entity) {
|
||||
return isSpotProtected(world, new ProtectionHelper() {
|
||||
return TileBlockProtector.isSpotProtected(world, new ProtectionHelper() {
|
||||
@Override
|
||||
public boolean checkProtection(TileBlockProtector tile) {
|
||||
return isSpotProtected(tile, entity);
|
||||
return TileBlockProtector.isSpotProtected(tile, entity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isSpotProtected(World world, ProtectionHelper helper) {
|
||||
for (int i = 0; i < protectors.size(); i++) {
|
||||
TileBlockProtector protector = protectors.get(i);
|
||||
for (int i = 0; i < TileBlockProtector.protectors.size(); i++) {
|
||||
TileBlockProtector protector = TileBlockProtector.protectors.get(i);
|
||||
if (protector.isInvalid()) {
|
||||
protectors.remove(i);
|
||||
TileBlockProtector.protectors.remove(i);
|
||||
i--;
|
||||
} else if (protector.worldObj.isRemote == world.isRemote
|
||||
&& helper.checkProtection(protector)) {
|
||||
@@ -251,7 +251,7 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static interface ProtectionHelper {
|
||||
private interface ProtectionHelper {
|
||||
boolean checkProtection(TileBlockProtector tile);
|
||||
}
|
||||
|
||||
@@ -260,11 +260,11 @@ public class TileBlockProtector extends TileJarFillable {
|
||||
if (entityAABB != null) {
|
||||
return tile.getProtectedAABB().intersectsWith(entityAABB.addCoord(entity.posX, entity.posY, entity.posZ));
|
||||
}
|
||||
return isSpotProtected(tile, entity.posX, entity.posY, entity.posZ);
|
||||
return TileBlockProtector.isSpotProtected(tile, entity.posX, entity.posY, entity.posZ);
|
||||
}
|
||||
|
||||
private AxisAlignedBB getProtectedAABB() {
|
||||
return AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range);
|
||||
return AxisAlignedBB.getBoundingBox(this.xCoord - this.range, this.yCoord - this.range, this.zCoord - this.range, this.xCoord + this.range, this.yCoord + this.range, this.zCoord + this.range);
|
||||
}
|
||||
|
||||
private static boolean isSpotProtected(TileBlockProtector tile, double x, double y, double z) {
|
||||
|
||||
@@ -42,11 +42,8 @@ import tuhljin.automagy.api.essentia.IAspectContainerWithMax;
|
||||
import tuhljin.automagy.api.essentia.IEssentiaLocusReadable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
@@ -56,116 +53,116 @@ import java.util.Map;
|
||||
*
|
||||
* Created by HellFirePvP @ 22.04.2016 21:42
|
||||
*/
|
||||
@Optional.InterfaceList(value = {
|
||||
@Optional.Interface(iface = "tuhljin.automagy.api.essentia.IEssentiaLocusReadable",modid = "Automagy"),
|
||||
@Optional.Interface(iface = "tuhljin.automagy.api.essentia.IAspectContainerWithMax",modid = "Automagy")
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "tuhljin.automagy.api.essentia.IEssentiaLocusReadable", modid = "Automagy"),
|
||||
@Optional.Interface(iface = "tuhljin.automagy.api.essentia.IAspectContainerWithMax", modid = "Automagy")
|
||||
})
|
||||
public class TileEssentiaCompressor extends SynchronizedTileEntity implements IAspectSource, IEssentiaTransport,IEssentiaLocusReadable, IAspectContainerWithMax {
|
||||
public class TileEssentiaCompressor extends SynchronizedTileEntity implements IEssentiaTransport,IEssentiaLocusReadable, IAspectContainerWithMax {
|
||||
|
||||
public static final int MAX_SIZE = 8;
|
||||
public static final int MAX_ASPECT_STORAGE = 3000, STD_ASPECT_STORAGE = 200;
|
||||
|
||||
private static Injector injEssentiaHandler = new Injector(EssentiaHandler.class);
|
||||
private static int multiblockIDCounter = 0;
|
||||
private static int multiblockIDCounter;
|
||||
|
||||
//Standard multiblock stuff
|
||||
private boolean isMasterTile = false; //For debugging
|
||||
private boolean isMasterTile; //For debugging
|
||||
private int multiblockYIndex = -1, multiblockId = -1;
|
||||
|
||||
private boolean isMultiblockPresent = false;
|
||||
private boolean isMultiblockPresent;
|
||||
|
||||
private int incSize = 0;
|
||||
private Vector3 coordPedestal = null;
|
||||
private int consumeTick = 0;
|
||||
private int incSize;
|
||||
private Vector3 coordPedestal;
|
||||
private int consumeTick;
|
||||
|
||||
private AspectList al = new AspectList();
|
||||
private int ticksExisted = 0;
|
||||
private boolean prevFound = false;
|
||||
private int ticksExisted;
|
||||
private boolean prevFound;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
ticksExisted++;
|
||||
this.ticksExisted++;
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(isMultiblockFormed()) {
|
||||
checkMultiblock();
|
||||
if(!this.worldObj.isRemote) {
|
||||
if(this.isMultiblockFormed()) {
|
||||
this.checkMultiblock();
|
||||
}
|
||||
|
||||
if(!isMultiblockFormed()) return;
|
||||
if(!this.isMultiblockFormed()) return;
|
||||
|
||||
if (isMasterTile() && (prevFound || (ticksExisted % 100) == 0)) {
|
||||
List<WorldCoordinates> coords = searchAndGetSources();
|
||||
if (this.isMasterTile() && (this.prevFound || (this.ticksExisted % 100) == 0)) {
|
||||
List<WorldCoordinates> coords = this.searchAndGetSources();
|
||||
if (coords == null || coords.isEmpty()) {
|
||||
prevFound = false;
|
||||
this.prevFound = false;
|
||||
} else {
|
||||
prevFound = searchForEssentia(coords);
|
||||
this.prevFound = this.searchForEssentia(coords);
|
||||
}
|
||||
}
|
||||
|
||||
if(isMasterTile() && ((incSize < MAX_SIZE && (ticksExisted % 40) == 0) || (coordPedestal != null))) {
|
||||
consumeElements();
|
||||
if(this.isMasterTile() && ((this.incSize < TileEssentiaCompressor.MAX_SIZE && (this.ticksExisted % 40) == 0) || (this.coordPedestal != null))) {
|
||||
this.consumeElements();
|
||||
}
|
||||
} else {
|
||||
if(isMasterTile() && isMultiblockFormed()) {
|
||||
playLightningEffects();
|
||||
playVortexEffects();
|
||||
if(al.visSize() > 0) {
|
||||
playEssentiaEffects();
|
||||
if(this.isMasterTile() && this.isMultiblockFormed()) {
|
||||
this.playLightningEffects();
|
||||
this.playVortexEffects();
|
||||
if(this.al.visSize() > 0) {
|
||||
this.playEssentiaEffects();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isMasterTile() && isMultiblockFormed()) {
|
||||
vortexEntities();
|
||||
if(this.isMasterTile() && this.isMultiblockFormed()) {
|
||||
this.vortexEntities();
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Automagy")
|
||||
public AspectList getAspectsBase() {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if (master == null)
|
||||
return null;
|
||||
return master.al;
|
||||
}
|
||||
return al;
|
||||
return this.al;
|
||||
}
|
||||
|
||||
private void consumeElements() {
|
||||
if(coordPedestal != null) {
|
||||
if(!checkPedestal(coordPedestal)) {
|
||||
consumeTick = 0;
|
||||
coordPedestal = null;
|
||||
if(this.coordPedestal != null) {
|
||||
if(!this.checkPedestal(this.coordPedestal)) {
|
||||
this.consumeTick = 0;
|
||||
this.coordPedestal = null;
|
||||
return;
|
||||
}
|
||||
consumeTick++;
|
||||
if(consumeTick <= 400) {
|
||||
this.consumeTick++;
|
||||
if(this.consumeTick <= 400) {
|
||||
PacketAnimationAbsorb absorb = new PacketAnimationAbsorb(
|
||||
xCoord, yCoord + 1, zCoord,
|
||||
coordPedestal.getBlockX(), coordPedestal.getBlockY() + 1, coordPedestal.getBlockZ(),
|
||||
this.xCoord, this.yCoord + 1, this.zCoord,
|
||||
this.coordPedestal.getBlockX(), this.coordPedestal.getBlockY() + 1, this.coordPedestal.getBlockZ(),
|
||||
5, Block.getIdFromBlock(ConfigBlocks.blockCosmeticSolid), 1);
|
||||
makeo.gadomancy.common.network.PacketHandler.INSTANCE.sendToAllAround(absorb, new NetworkRegistry.TargetPoint(
|
||||
getWorldObj().provider.dimensionId,
|
||||
xCoord, yCoord, zCoord, 16));
|
||||
this.getWorldObj().provider.dimensionId,
|
||||
this.xCoord, this.yCoord, this.zCoord, 16));
|
||||
} else {
|
||||
TilePedestal te = (TilePedestal) worldObj.getTileEntity(
|
||||
coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
|
||||
TilePedestal te = (TilePedestal) this.worldObj.getTileEntity(
|
||||
this.coordPedestal.getBlockX(), this.coordPedestal.getBlockY(), this.coordPedestal.getBlockZ());
|
||||
te.setInventorySlotContents(0, null);
|
||||
te.markDirty();
|
||||
worldObj.markBlockForUpdate(
|
||||
coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
|
||||
consumeTick = 0;
|
||||
coordPedestal = null;
|
||||
incSize += 1;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
this.worldObj.markBlockForUpdate(
|
||||
this.coordPedestal.getBlockX(), this.coordPedestal.getBlockY(), this.coordPedestal.getBlockZ());
|
||||
this.consumeTick = 0;
|
||||
this.coordPedestal = null;
|
||||
this.incSize += 1;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
}
|
||||
} else {
|
||||
for (int xx = -3; xx <= 3; xx++) {
|
||||
for (int zz = -3; zz <= 3; zz++) {
|
||||
Vector3 offset = new Vector3(xCoord + xx, yCoord, zCoord + zz);
|
||||
if(checkPedestal(offset)) {
|
||||
Vector3 offset = new Vector3(this.xCoord + xx, this.yCoord, this.zCoord + zz);
|
||||
if(this.checkPedestal(offset)) {
|
||||
this.coordPedestal = offset;
|
||||
this.consumeTick = 0;
|
||||
return;
|
||||
@@ -178,11 +175,11 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
}
|
||||
|
||||
private boolean checkPedestal(Vector3 coordPedestal) {
|
||||
Block at = worldObj.getBlock(
|
||||
Block at = this.worldObj.getBlock(
|
||||
coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
|
||||
int md = worldObj.getBlockMetadata(
|
||||
int md = this.worldObj.getBlockMetadata(
|
||||
coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
|
||||
TileEntity te = worldObj.getTileEntity(
|
||||
TileEntity te = this.worldObj.getTileEntity(
|
||||
coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
|
||||
if(at == null || te == null || md != 1) return false;
|
||||
if(!at.equals(RegisteredBlocks.blockStoneMachine) || !(te instanceof TilePedestal)) return false;
|
||||
@@ -193,12 +190,12 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
//only call from master tile.
|
||||
private boolean searchForEssentia(List<WorldCoordinates> coordinates) {
|
||||
if(ticksExisted % 10 != 0) return prevFound;
|
||||
if(this.ticksExisted % 10 != 0) return this.prevFound;
|
||||
for (Aspect a : Aspect.aspects.values()) {
|
||||
if (doDrain(a, coordinates)) {
|
||||
al.add(a, 1);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
if (this.doDrain(a, coordinates)) {
|
||||
this.al.add(a, 1);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -208,7 +205,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
//only call from master tile.
|
||||
private boolean doDrain(Aspect a, List<WorldCoordinates> coordinates) {
|
||||
for (WorldCoordinates coordinate : coordinates) {
|
||||
TileEntity sourceTile = worldObj.getTileEntity(coordinate.x, coordinate.y, coordinate.z);
|
||||
TileEntity sourceTile = this.worldObj.getTileEntity(coordinate.x, coordinate.y, coordinate.z);
|
||||
if (!(sourceTile instanceof IAspectSource)) {
|
||||
continue;
|
||||
}
|
||||
@@ -216,14 +213,14 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
continue;
|
||||
IAspectSource as = (IAspectSource)sourceTile;
|
||||
AspectList contains = as.getAspects();
|
||||
if(contains == null || contains.visSize() > al.visSize())
|
||||
if(contains == null || contains.visSize() > this.al.visSize())
|
||||
continue;
|
||||
if(!canAccept(a))
|
||||
if(!this.canAccept(a))
|
||||
continue;
|
||||
if (as.takeFromContainer(a, 1)) {
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXEssentiaSource(xCoord, yCoord + 1, zCoord,
|
||||
(byte)(xCoord - coordinate.x), (byte)(yCoord - coordinate.y + 1), (byte)(zCoord - coordinate.z),
|
||||
a.getColor()), new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord + 1, zCoord, 32.0D));
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXEssentiaSource(this.xCoord, this.yCoord + 1, this.zCoord,
|
||||
(byte)(this.xCoord - coordinate.x), (byte)(this.yCoord - coordinate.y + 1), (byte)(this.zCoord - coordinate.z),
|
||||
a.getColor()), new NetworkRegistry.TargetPoint(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord + 1, this.zCoord, 32.0D));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -231,31 +228,31 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
}
|
||||
|
||||
private boolean canAccept(Aspect a) {
|
||||
int current = al.getAmount(a);
|
||||
int max = STD_ASPECT_STORAGE + incSize * ((MAX_ASPECT_STORAGE - STD_ASPECT_STORAGE) / MAX_SIZE);
|
||||
int current = this.al.getAmount(a);
|
||||
int max = TileEssentiaCompressor.STD_ASPECT_STORAGE + this.incSize * ((TileEssentiaCompressor.MAX_ASPECT_STORAGE - TileEssentiaCompressor.STD_ASPECT_STORAGE) / TileEssentiaCompressor.MAX_SIZE);
|
||||
return current < max;
|
||||
}
|
||||
|
||||
public int getSizeStage() {
|
||||
return incSize;
|
||||
return this.incSize;
|
||||
}
|
||||
|
||||
float tr = 1.0F;
|
||||
float tri = 0.0F;
|
||||
float tri;
|
||||
float tg = 1.0F;
|
||||
float tgi = 0.0F;
|
||||
float tgi;
|
||||
float tb = 1.0F;
|
||||
float tbi = 0.0F;
|
||||
float tbi;
|
||||
public float cr = 1.0F;
|
||||
public float cg = 1.0F;
|
||||
public float cb = 1.0F;
|
||||
public Aspect displayAspect = null;
|
||||
public Aspect displayAspect;
|
||||
|
||||
//Thanks @TileEssentiaReservoir :P
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void playEssentiaEffects() {
|
||||
if ((ClientHandler.ticks % 20 == 0) && (al.size() > 0)) {
|
||||
this.displayAspect = al.getAspects()[(ClientHandler.ticks / 20 % al.size())];
|
||||
if ((ClientHandler.ticks % 20 == 0) && (this.al.size() > 0)) {
|
||||
this.displayAspect = this.al.getAspects()[(ClientHandler.ticks / 20 % this.al.size())];
|
||||
Color c = new Color(this.displayAspect.getColor());
|
||||
this.tr = (c.getRed() / 255.0F);
|
||||
this.tg = (c.getGreen() / 255.0F);
|
||||
@@ -273,64 +270,64 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
this.cb -= this.tbi;
|
||||
}
|
||||
int count = 1;
|
||||
cr = Math.min(1.0F, Math.max(0.0F, cr));
|
||||
cg = Math.min(1.0F, Math.max(0.0F, cg));
|
||||
cb = Math.min(1.0F, Math.max(0.0F, cb));
|
||||
FXEssentiaTrail essentiaTrail = new FXEssentiaTrail(worldObj, xCoord + 0.5, yCoord + 0.4, zCoord + 0.5, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, count, new Color(cr, cg, cb).getRGB(), 0.8F);
|
||||
this.cr = Math.min(1.0F, Math.max(0.0F, this.cr));
|
||||
this.cg = Math.min(1.0F, Math.max(0.0F, this.cg));
|
||||
this.cb = Math.min(1.0F, Math.max(0.0F, this.cb));
|
||||
FXEssentiaTrail essentiaTrail = new FXEssentiaTrail(this.worldObj, this.xCoord + 0.5, this.yCoord + 0.4, this.zCoord + 0.5, this.xCoord + 0.5, this.yCoord + 1.5, this.zCoord + 0.5, count, new Color(this.cr, this.cg, this.cb).getRGB(), 0.8F);
|
||||
essentiaTrail.noClip = true;
|
||||
essentiaTrail.motionY = (0.01F + MathHelper.sin(count / 3.0F) * 0.001F);
|
||||
essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
|
||||
essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
|
||||
ParticleEngine.instance.addEffect(worldObj, essentiaTrail);
|
||||
essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.01F + this.worldObj.rand.nextGaussian() * 0.01D);
|
||||
essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.01F + this.worldObj.rand.nextGaussian() * 0.01D);
|
||||
ParticleEngine.instance.addEffect(this.worldObj, essentiaTrail);
|
||||
|
||||
essentiaTrail = new FXEssentiaTrail(worldObj, xCoord + 0.5, yCoord + 2.6, zCoord + 0.5, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, count, new Color(cr, cg, cb).getRGB(), 0.8F);
|
||||
essentiaTrail = new FXEssentiaTrail(this.worldObj, this.xCoord + 0.5, this.yCoord + 2.6, this.zCoord + 0.5, this.xCoord + 0.5, this.yCoord + 1.5, this.zCoord + 0.5, count, new Color(this.cr, this.cg, this.cb).getRGB(), 0.8F);
|
||||
essentiaTrail.noClip = true;
|
||||
essentiaTrail.motionY = -(0.01F + MathHelper.sin(count / 3.0F) * 0.001F);
|
||||
essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
|
||||
essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
|
||||
ParticleEngine.instance.addEffect(worldObj, essentiaTrail);
|
||||
essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.01F + this.worldObj.rand.nextGaussian() * 0.01D);
|
||||
essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.01F + this.worldObj.rand.nextGaussian() * 0.01D);
|
||||
ParticleEngine.instance.addEffect(this.worldObj, essentiaTrail);
|
||||
}
|
||||
|
||||
private List<WorldCoordinates> searchAndGetSources() {
|
||||
WorldCoordinates thisCoordinates = new WorldCoordinates(this);
|
||||
Map<WorldCoordinates, List<WorldCoordinates>> teSources = new HashMap<WorldCoordinates, List<WorldCoordinates>>();
|
||||
getSourcesField(teSources);
|
||||
this.getSourcesField(teSources);
|
||||
if(!teSources.containsKey(thisCoordinates)) {
|
||||
searchSources();
|
||||
getSourcesField(teSources);
|
||||
this.searchSources();
|
||||
this.getSourcesField(teSources);
|
||||
if(teSources.containsKey(thisCoordinates)) {
|
||||
return searchAndGetSources();
|
||||
return this.searchAndGetSources();
|
||||
}
|
||||
return new ArrayList<WorldCoordinates>();
|
||||
}
|
||||
List<WorldCoordinates> result = teSources.get(thisCoordinates);
|
||||
((Map<WorldCoordinates, List<WorldCoordinates>>) injEssentiaHandler.getField("sources")).remove(thisCoordinates);
|
||||
((Map<WorldCoordinates, List<WorldCoordinates>>) TileEssentiaCompressor.injEssentiaHandler.getField("sources")).remove(thisCoordinates);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void searchSources() {
|
||||
WorldCoordinates thisCoord = new WorldCoordinates(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
WorldCoordinates thisCoord = new WorldCoordinates(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId);
|
||||
List<WorldCoordinates> coords = new LinkedList<WorldCoordinates>();
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
|
||||
unsafe_search(thisCoord, direction, coords);
|
||||
this.unsafe_search(thisCoord, direction, coords);
|
||||
}
|
||||
|
||||
((Map<WorldCoordinates, List<WorldCoordinates>>) injEssentiaHandler.getField("sources")).put(thisCoord, coords);
|
||||
((Map<WorldCoordinates, List<WorldCoordinates>>) TileEssentiaCompressor.injEssentiaHandler.getField("sources")).put(thisCoord, coords);
|
||||
}
|
||||
|
||||
private void unsafe_search(WorldCoordinates coord, ForgeDirection direction, List<WorldCoordinates> out) {
|
||||
((HashMap<WorldCoordinates, Long>) injEssentiaHandler.getField("sourcesDelay")).remove(coord);
|
||||
injEssentiaHandler.invokeMethod("getSources", new Class[]{ World.class, WorldCoordinates.class, ForgeDirection.class, int.class }, worldObj, coord, direction, 5);
|
||||
List<WorldCoordinates> coords = ((Map<WorldCoordinates, List<WorldCoordinates>>) injEssentiaHandler.getField("sources")).get(coord);
|
||||
((HashMap<WorldCoordinates, Long>) TileEssentiaCompressor.injEssentiaHandler.getField("sourcesDelay")).remove(coord);
|
||||
TileEssentiaCompressor.injEssentiaHandler.invokeMethod("getSources", new Class[]{ World.class, WorldCoordinates.class, ForgeDirection.class, int.class }, this.worldObj, coord, direction, 5);
|
||||
List<WorldCoordinates> coords = ((Map<WorldCoordinates, List<WorldCoordinates>>) TileEssentiaCompressor.injEssentiaHandler.getField("sources")).get(coord);
|
||||
if(coords != null) {
|
||||
out.addAll(((Map<WorldCoordinates, List<WorldCoordinates>>) injEssentiaHandler.getField("sources")).get(coord));
|
||||
((Map<WorldCoordinates, List<WorldCoordinates>>) injEssentiaHandler.getField("sources")).remove(coord);
|
||||
out.addAll(((Map<WorldCoordinates, List<WorldCoordinates>>) TileEssentiaCompressor.injEssentiaHandler.getField("sources")).get(coord));
|
||||
((Map<WorldCoordinates, List<WorldCoordinates>>) TileEssentiaCompressor.injEssentiaHandler.getField("sources")).remove(coord);
|
||||
}
|
||||
}
|
||||
|
||||
private void getSourcesField(Map<WorldCoordinates, List<WorldCoordinates>> out) {
|
||||
out.clear();
|
||||
out.putAll((Map<? extends WorldCoordinates, ? extends List<WorldCoordinates>>) injEssentiaHandler.getField("sources"));
|
||||
out.putAll(TileEssentiaCompressor.injEssentiaHandler.getField("sources"));
|
||||
}
|
||||
|
||||
private void playVortexEffects() {
|
||||
@@ -345,7 +342,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
Vec3 v2 = Vec3.createVectorHelper(tx + 0.5D, ty + 0.5D, tz + 0.5D);
|
||||
|
||||
MovingObjectPosition mop = ThaumcraftApiHelper.rayTraceIgnoringSource(this.worldObj, v1, v2, true, false, false);
|
||||
if ((mop != null) && (getDistanceFrom(mop.blockX, mop.blockY, mop.blockZ) < 16.0D)) {
|
||||
if ((mop != null) && (this.getDistanceFrom(mop.blockX, mop.blockY, mop.blockZ) < 16.0D)) {
|
||||
tx = mop.blockX;
|
||||
ty = mop.blockY;
|
||||
tz = mop.blockZ;
|
||||
@@ -360,19 +357,19 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void playLightningEffects() {
|
||||
if(incSize < 6) {
|
||||
if(incSize < 2) {
|
||||
if(worldObj.rand.nextInt(6) != 0) return;
|
||||
if(this.incSize < 6) {
|
||||
if(this.incSize < 2) {
|
||||
if(this.worldObj.rand.nextInt(6) != 0) return;
|
||||
} else {
|
||||
if(worldObj.rand.nextBoolean()) return;
|
||||
if(this.worldObj.rand.nextBoolean()) return;
|
||||
}
|
||||
}
|
||||
double originX = xCoord + 0.5;
|
||||
double originY = yCoord + 1.5;
|
||||
double originZ = zCoord + 0.5;
|
||||
double targetX = xCoord + 0.4 + worldObj.rand.nextFloat() * 0.2;
|
||||
double targetY = yCoord + 0.4 + (worldObj.rand.nextBoolean() ? 2.2 : 0);
|
||||
double targetZ = zCoord + 0.4 + worldObj.rand.nextFloat() * 0.2;
|
||||
double originX = this.xCoord + 0.5;
|
||||
double originY = this.yCoord + 1.5;
|
||||
double originZ = this.zCoord + 0.5;
|
||||
double targetX = this.xCoord + 0.4 + this.worldObj.rand.nextFloat() * 0.2;
|
||||
double targetY = this.yCoord + 0.4 + (this.worldObj.rand.nextBoolean() ? 2.2 : 0);
|
||||
double targetZ = this.zCoord + 0.4 + this.worldObj.rand.nextFloat() * 0.2;
|
||||
FXLightningBolt bolt = new FXLightningBolt(Minecraft.getMinecraft().theWorld, originX, originY, originZ,
|
||||
targetX, targetY, targetZ, Minecraft.getMinecraft().theWorld.rand.nextLong(), 10, 4.0F, 5);
|
||||
bolt.defaultFractal();
|
||||
@@ -381,24 +378,24 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
}
|
||||
|
||||
private void vortexEntities() {
|
||||
if(incSize <= 0) return;
|
||||
List entities = worldObj.getEntitiesWithinAABB(Entity.class,
|
||||
AxisAlignedBB.getBoundingBox(xCoord - 0.5, yCoord - 0.5, zCoord - 0.5,
|
||||
xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(4, 4, 4));
|
||||
if(this.incSize <= 0) return;
|
||||
List entities = this.worldObj.getEntitiesWithinAABB(Entity.class,
|
||||
AxisAlignedBB.getBoundingBox(this.xCoord - 0.5, this.yCoord - 0.5, this.zCoord - 0.5,
|
||||
this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5).expand(4, 4, 4));
|
||||
for (Object o : entities) {
|
||||
if(o == null ||
|
||||
!(o instanceof Entity) ||
|
||||
((Entity) o).isDead) continue;
|
||||
applyMovementVectors((Entity) o);
|
||||
this.applyMovementVectors((Entity) o);
|
||||
}
|
||||
}
|
||||
|
||||
private void applyMovementVectors(Entity entity) {
|
||||
double mult = incSize * (1D / ((double) MAX_SIZE));
|
||||
double mult = this.incSize * (1D / ((double) TileEssentiaCompressor.MAX_SIZE));
|
||||
|
||||
double var3 = (xCoord + 0.5D - entity.posX) / 8.0D;
|
||||
double var5 = (yCoord + 1.5D - entity.posY) / 8.0D;
|
||||
double var7 = (zCoord + 0.5D - entity.posZ) / 8.0D;
|
||||
double var3 = (this.xCoord + 0.5D - entity.posX) / 8.0D;
|
||||
double var5 = (this.yCoord + 1.5D - entity.posY) / 8.0D;
|
||||
double var7 = (this.zCoord + 0.5D - entity.posZ) / 8.0D;
|
||||
double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7);
|
||||
double var11 = 1.0D - var9;
|
||||
if (var11 > 0.0D) {
|
||||
@@ -410,75 +407,75 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
}
|
||||
|
||||
public void checkMultiblock() {
|
||||
if(isMasterTile) {
|
||||
boolean canSustain = isMultiblockableBlock(1);
|
||||
if(!isMultiblockableBlock(2)) canSustain = false;
|
||||
if(this.isMasterTile) {
|
||||
boolean canSustain = this.isMultiblockableBlock(1);
|
||||
if(!this.isMultiblockableBlock(2)) canSustain = false;
|
||||
if(!canSustain) {
|
||||
breakMultiblock();
|
||||
isMultiblockPresent = false;
|
||||
this.breakMultiblock();
|
||||
this.isMultiblockPresent = false;
|
||||
}
|
||||
} else {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master != null) {
|
||||
if(!master.isMultiblockPresent) {
|
||||
breakMultiblock();
|
||||
this.breakMultiblock();
|
||||
}
|
||||
} else {
|
||||
breakMultiblock();
|
||||
this.breakMultiblock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public TileEssentiaCompressor tryFindMasterTile() {
|
||||
if(!isMultiblockFormed())
|
||||
if(!this.isMultiblockFormed())
|
||||
return null;
|
||||
if(isMasterTile())
|
||||
if(this.isMasterTile())
|
||||
return this; //lul.. check before plz.
|
||||
Block down = worldObj.getBlock(xCoord, yCoord - multiblockYIndex, zCoord);
|
||||
Block down = this.worldObj.getBlock(this.xCoord, this.yCoord - this.multiblockYIndex, this.zCoord);
|
||||
if(!down.equals(RegisteredBlocks.blockEssentiaCompressor))
|
||||
return null;
|
||||
TileEntity te = worldObj.getTileEntity(xCoord, yCoord - multiblockYIndex, zCoord);
|
||||
TileEntity te = this.worldObj.getTileEntity(this.xCoord, this.yCoord - this.multiblockYIndex, this.zCoord);
|
||||
if(!(te instanceof TileEssentiaCompressor))
|
||||
return null;
|
||||
TileEssentiaCompressor compressor = (TileEssentiaCompressor) te;
|
||||
if(compressor.multiblockId != multiblockId || !compressor.isMasterTile())
|
||||
if(compressor.multiblockId != this.multiblockId || !compressor.isMasterTile())
|
||||
return null;
|
||||
return compressor;
|
||||
}
|
||||
|
||||
private boolean isMultiblockableBlock(int yOffset) {
|
||||
Block block = worldObj.getBlock(xCoord, yCoord + yOffset, zCoord);
|
||||
TileEntity te = worldObj.getTileEntity(xCoord, yCoord + yOffset, zCoord);
|
||||
Block block = this.worldObj.getBlock(this.xCoord, this.yCoord + yOffset, this.zCoord);
|
||||
TileEntity te = this.worldObj.getTileEntity(this.xCoord, this.yCoord + yOffset, this.zCoord);
|
||||
if(!block.equals(RegisteredBlocks.blockEssentiaCompressor)) return false;
|
||||
if(!(te instanceof TileEssentiaCompressor)) return false;
|
||||
TileEssentiaCompressor compressor = (TileEssentiaCompressor) te;
|
||||
return compressor.multiblockId == multiblockId;
|
||||
return compressor.multiblockId == this.multiblockId;
|
||||
}
|
||||
|
||||
public void breakMultiblock() {
|
||||
doExplosion();
|
||||
this.doExplosion();
|
||||
this.multiblockId = -1;
|
||||
this.isMasterTile = false;
|
||||
this.multiblockYIndex = -1;
|
||||
this.al = new AspectList();
|
||||
markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
private void doExplosion() {
|
||||
AspectList al = getAspects();
|
||||
AspectList al = this.getAspects();
|
||||
if(al.visSize() > 0) {
|
||||
ExplosionHelper.taintplosion(worldObj, xCoord, yCoord, zCoord, true, 2, 2.0F, 4, 20);
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
ExplosionHelper.taintplosion(this.worldObj, this.xCoord, this.yCoord, this.zCoord, true, 2, 2.0F, 4, 20);
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
} else {
|
||||
ExplosionHelper.taintplosion(worldObj, xCoord, yCoord, zCoord, false, 0, 2.0F, 4, 20);
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
ExplosionHelper.taintplosion(this.worldObj, this.xCoord, this.yCoord, this.zCoord, false, 0, 2.0F, 4, 20);
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getAndIncrementNewMultiblockId() {
|
||||
multiblockIDCounter++;
|
||||
return multiblockIDCounter;
|
||||
TileEssentiaCompressor.multiblockIDCounter++;
|
||||
return TileEssentiaCompressor.multiblockIDCounter;
|
||||
}
|
||||
|
||||
public void setInMultiblock(boolean isMaster, int yIndex, int multiblockId) {
|
||||
@@ -489,20 +486,20 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
this.isMultiblockPresent = true; //Initial state.
|
||||
}
|
||||
this.al = new AspectList();
|
||||
markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.markDirty();
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public boolean isMultiblockFormed() {
|
||||
return multiblockId != -1;
|
||||
return this.multiblockId != -1;
|
||||
}
|
||||
|
||||
public boolean isMasterTile() {
|
||||
return isMasterTile;
|
||||
return this.isMasterTile;
|
||||
}
|
||||
|
||||
public int getMultiblockYIndex() {
|
||||
return multiblockYIndex;
|
||||
return this.multiblockYIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -534,21 +531,21 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
compound.setBoolean("multiblockPresent", this.isMasterTile);
|
||||
compound.setInteger("sizeInc", this.incSize);
|
||||
NBTTagCompound aspects = new NBTTagCompound();
|
||||
for (Aspect a : al.aspects.keySet()) {
|
||||
aspects.setInteger(a.getTag(), al.aspects.get(a));
|
||||
for (Aspect a : this.al.aspects.keySet()) {
|
||||
aspects.setInteger(a.getTag(), this.al.aspects.get(a));
|
||||
}
|
||||
compound.setTag("aspects", aspects);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
if(!isMultiblockFormed()) {
|
||||
if(!this.isMultiblockFormed()) {
|
||||
return new AspectList();
|
||||
} else {
|
||||
if(isMasterTile()) {
|
||||
return al;
|
||||
if(this.isMasterTile()) {
|
||||
return this.al;
|
||||
} else {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return new AspectList();
|
||||
return master.getAspects();
|
||||
}
|
||||
@@ -560,17 +557,17 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public boolean doesContainerAccept(Aspect aspect) {
|
||||
return isMultiblockFormed() && multiblockYIndex == 1 && canAccept(aspect);
|
||||
return this.isMultiblockFormed() && this.multiblockYIndex == 1 && this.canAccept(aspect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addToContainer(Aspect aspect, int i) {
|
||||
if(doesContainerAccept(aspect) && canAccept(aspect)) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.doesContainerAccept(aspect) && this.canAccept(aspect)) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return 0;
|
||||
master.al.add(aspect, i);
|
||||
worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
markDirty();
|
||||
this.worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
this.markDirty();
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
@@ -579,13 +576,13 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(Aspect aspect, int i) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return false;
|
||||
boolean couldTake = master.al.reduce(aspect, i);
|
||||
master.al.remove(aspect, 0);
|
||||
worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
markDirty();
|
||||
this.worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
this.markDirty();
|
||||
return couldTake;
|
||||
}
|
||||
return false;
|
||||
@@ -599,8 +596,8 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(Aspect aspect, int i) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return false;
|
||||
return master.al.getAmount(aspect) >= i;
|
||||
}
|
||||
@@ -615,8 +612,8 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public int containerContains(Aspect aspect) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return 0;
|
||||
return master.al.getAmount(aspect);
|
||||
}
|
||||
@@ -632,7 +629,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public boolean canInputFrom(ForgeDirection direction) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) { //The middle one
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) { //The middle one
|
||||
return direction == ForgeDirection.SOUTH ||
|
||||
direction == ForgeDirection.NORTH ||
|
||||
direction == ForgeDirection.EAST ||
|
||||
@@ -643,7 +640,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public boolean canOutputTo(ForgeDirection direction) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) { //The middle one
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) { //The middle one
|
||||
return direction == ForgeDirection.SOUTH ||
|
||||
direction == ForgeDirection.NORTH ||
|
||||
direction == ForgeDirection.EAST ||
|
||||
@@ -666,7 +663,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection direction) {
|
||||
if(canInputFrom(direction)) {
|
||||
if(this.canInputFrom(direction)) {
|
||||
return 16;
|
||||
}
|
||||
return 0;
|
||||
@@ -674,14 +671,14 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public int takeEssentia(Aspect aspect, int i, ForgeDirection direction) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
if(!canOutputTo(direction)) return 0;
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
if(!this.canOutputTo(direction)) return 0;
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return 0;
|
||||
int amt = master.al.getAmount(aspect);
|
||||
int taken = amt - master.al.remove(aspect, i).getAmount(aspect);
|
||||
worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
markDirty();
|
||||
this.worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
this.markDirty();
|
||||
return taken;
|
||||
}
|
||||
return 0;
|
||||
@@ -689,12 +686,12 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public int addEssentia(Aspect aspect, int i, ForgeDirection direction) {
|
||||
if(canInputFrom(direction) && canAccept(aspect)) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.canInputFrom(direction) && this.canAccept(aspect)) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return 0;
|
||||
master.al.add(aspect, i);
|
||||
worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
markDirty();
|
||||
this.worldObj.markBlockForUpdate(master.xCoord, master.yCoord, master.zCoord);
|
||||
this.markDirty();
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
@@ -702,18 +699,18 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity implements IA
|
||||
|
||||
@Override
|
||||
public Aspect getEssentiaType(ForgeDirection direction) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return null;
|
||||
return new ArrayList<Aspect>(master.al.aspects.keySet()).get(worldObj.rand.nextInt(master.al.size()));
|
||||
return new ArrayList<Aspect>(master.al.aspects.keySet()).get(this.worldObj.rand.nextInt(master.al.size()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEssentiaAmount(ForgeDirection direction) {
|
||||
if(isMultiblockFormed() && multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = tryFindMasterTile();
|
||||
if(this.isMultiblockFormed() && this.multiblockYIndex == 1) {
|
||||
TileEssentiaCompressor master = this.tryFindMasterTile();
|
||||
if(master == null) return 0;
|
||||
return master.al.visSize();
|
||||
}
|
||||
|
||||
@@ -37,13 +37,13 @@ import java.util.List;
|
||||
*
|
||||
* Created by HellFirePvP @ 21.10.2015 23:39
|
||||
*/
|
||||
public class TileExtendedNode extends TileNode implements INode {
|
||||
public class TileExtendedNode extends TileNode {
|
||||
|
||||
public int ticksExisted = 0;
|
||||
public int ticksExisted;
|
||||
private ExtendedNodeType extendedNodeType;
|
||||
private GrowingNodeBehavior behavior;
|
||||
|
||||
private boolean doingVortexExplosion = false;
|
||||
private boolean doingVortexExplosion;
|
||||
private ExplosionHelper.VortexExplosion vortexExplosion;
|
||||
|
||||
|
||||
@@ -55,54 +55,54 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
ticksExisted++;
|
||||
this.ticksExisted++;
|
||||
|
||||
if(this.doingVortexExplosion) {
|
||||
if(this.vortexExplosion == null) {
|
||||
this.vortexExplosion = new ExplosionHelper.VortexExplosion(this);
|
||||
}
|
||||
if(vortexExplosion.isFinished()) {
|
||||
if(this.vortexExplosion.isFinished()) {
|
||||
this.vortexExplosion = null;
|
||||
this.doingVortexExplosion = false;
|
||||
} else {
|
||||
vortexExplosion.update();
|
||||
this.vortexExplosion.update();
|
||||
}
|
||||
}
|
||||
|
||||
boolean needUpdate;
|
||||
|
||||
needUpdate = handleGrowingNodeFirst(false);
|
||||
needUpdate = handleGrowingNodeSecond(needUpdate);
|
||||
needUpdate = this.handleGrowingNodeFirst(false);
|
||||
needUpdate = this.handleGrowingNodeSecond(needUpdate);
|
||||
|
||||
if(!worldObj.isRemote && needUpdate) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
if(!this.worldObj.isRemote && needUpdate) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleGrowingNodeSecond(boolean needUpdate) {
|
||||
if(extendedNodeType == null || extendedNodeType != ExtendedNodeType.GROWING) return needUpdate;
|
||||
if(this.extendedNodeType == null || this.extendedNodeType != ExtendedNodeType.GROWING) return needUpdate;
|
||||
|
||||
if(worldObj.difficultySetting == EnumDifficulty.PEACEFUL) return needUpdate;
|
||||
if(worldObj.isRemote) return needUpdate;
|
||||
if(ticksExisted % 8 != 0) return needUpdate;
|
||||
if(this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) return needUpdate;
|
||||
if(this.worldObj.isRemote) return needUpdate;
|
||||
if(this.ticksExisted % 8 != 0) return needUpdate;
|
||||
|
||||
List livingEntities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1).expand(6.0D, 6.0D, 6.0D));
|
||||
List livingEntities = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1).expand(6.0D, 6.0D, 6.0D));
|
||||
if ((livingEntities != null) && (livingEntities.size() > 0)) {
|
||||
for (Object e : livingEntities) {
|
||||
EntityLivingBase livingEntity = (EntityLivingBase) e;
|
||||
if ((livingEntity.isEntityAlive()) && (!livingEntity.isEntityInvulnerable())) {
|
||||
if(livingEntity instanceof EntityPlayer && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) continue;
|
||||
if(!behavior.mayZapNow()) continue;
|
||||
if(!this.behavior.mayZapNow()) continue;
|
||||
|
||||
ResearchHelper.distributeResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", worldObj, xCoord, yCoord, zCoord, 6);
|
||||
ResearchHelper.distributeResearch(Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", this.worldObj, this.xCoord, this.yCoord, this.zCoord, 6);
|
||||
|
||||
livingEntity.attackEntityFrom(DamageSource.magic, behavior.getZapDamage());
|
||||
livingEntity.attackEntityFrom(DamageSource.magic, this.behavior.getZapDamage());
|
||||
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "thaumcraft:zap", 0.8F, 1.0F);
|
||||
this.worldObj.playSoundEffect(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, "thaumcraft:zap", 0.8F, 1.0F);
|
||||
|
||||
PacketTCNodeBolt packet = new PacketTCNodeBolt(xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ, 0, false);
|
||||
PacketHandler.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 32.0D));
|
||||
PacketTCNodeBolt packet = new PacketTCNodeBolt(this.xCoord + 0.5F, this.yCoord + 0.5F, this.zCoord + 0.5F, (float) livingEntity.posX, (float) (livingEntity.posY + livingEntity.height), (float) livingEntity.posZ, 0, false);
|
||||
PacketHandler.INSTANCE.sendToAllAround(packet, new NetworkRegistry.TargetPoint(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32.0D));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,9 +111,9 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
}
|
||||
|
||||
private boolean handleGrowingNodeFirst(boolean needUpdate) {
|
||||
if(extendedNodeType == null || extendedNodeType != ExtendedNodeType.GROWING) return needUpdate;
|
||||
if(this.extendedNodeType == null || this.extendedNodeType != ExtendedNodeType.GROWING) return needUpdate;
|
||||
|
||||
needUpdate = doVortex(EntityAspectOrb.class, needUpdate, new GrowingNodeVortexRunnable<EntityAspectOrb>() {
|
||||
needUpdate = this.doVortex(EntityAspectOrb.class, needUpdate, new GrowingNodeVortexRunnable<EntityAspectOrb>() {
|
||||
@Override
|
||||
public Aspect getAspect(EntityAspectOrb entity) {
|
||||
return entity.getAspect();
|
||||
@@ -124,7 +124,7 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
return GrowingNodeBehavior.AspectType.ASPECT_ORB;
|
||||
}
|
||||
});
|
||||
needUpdate = doVortex(EntityItem.class, needUpdate, new GrowingNodeVortexRunnable<EntityItem>() {
|
||||
needUpdate = this.doVortex(EntityItem.class, needUpdate, new GrowingNodeVortexRunnable<EntityItem>() {
|
||||
@Override
|
||||
public boolean doesVortex(EntityItem entity) {
|
||||
return entity.getEntityItem().getItem() instanceof ItemWispEssence || entity.getEntityItem().getItem() instanceof ItemManaBean || entity.getEntityItem().getItem() instanceof ItemCrystalEssence;
|
||||
@@ -141,7 +141,7 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
return entity.getEntityItem().getItem() instanceof ItemWispEssence ? GrowingNodeBehavior.AspectType.WISP_ESSENCE : entity.getEntityItem().getItem() instanceof ItemCrystalEssence ? GrowingNodeBehavior.AspectType.CRYSTAL_ESSENCE : GrowingNodeBehavior.AspectType.MANA_BEAN;
|
||||
}
|
||||
});
|
||||
needUpdate = doVortex(EntityWisp.class, needUpdate, new GrowingNodeVortexRunnable<EntityWisp>() {
|
||||
needUpdate = this.doVortex(EntityWisp.class, needUpdate, new GrowingNodeVortexRunnable<EntityWisp>() {
|
||||
@Override
|
||||
public Aspect getAspect(EntityWisp entity) {
|
||||
return Aspect.getAspect(entity.getType());
|
||||
@@ -152,26 +152,26 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
return GrowingNodeBehavior.AspectType.WISP;
|
||||
}
|
||||
});
|
||||
if(worldObj.isRemote) return needUpdate;
|
||||
if(this.worldObj.isRemote) return needUpdate;
|
||||
|
||||
if(behavior.lookingForNode()) {
|
||||
int xx = worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
|
||||
int yy = worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
|
||||
int zz = worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
|
||||
TileEntity t = worldObj.getTileEntity(xCoord + xx, yCoord + yy, zCoord + zz);
|
||||
if(this.behavior.lookingForNode()) {
|
||||
int xx = this.worldObj.rand.nextInt(8) - this.worldObj.rand.nextInt(8);
|
||||
int yy = this.worldObj.rand.nextInt(8) - this.worldObj.rand.nextInt(8);
|
||||
int zz = this.worldObj.rand.nextInt(8) - this.worldObj.rand.nextInt(8);
|
||||
TileEntity t = this.worldObj.getTileEntity(this.xCoord + xx, this.yCoord + yy, this.zCoord + zz);
|
||||
if(t != null && t instanceof TileNode && !(xx == 0 && yy == 0 && zz == 0)) {
|
||||
TileNode node = (TileNode) t;
|
||||
int thisSize = getAspectsBase().visSize();
|
||||
int thisSize = this.getAspectsBase().visSize();
|
||||
int othersSize = node.getAspectsBase().visSize();
|
||||
if(thisSize >= othersSize) {
|
||||
behavior.lockOnTo(node);
|
||||
worldObj.markBlockForUpdate(xCoord + xx, yCoord + yy, zCoord + zz);
|
||||
this.behavior.lockOnTo(node);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord + xx, this.yCoord + yy, this.zCoord + zz);
|
||||
node.markDirty();
|
||||
needUpdate = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
needUpdate = behavior.updateBehavior(needUpdate);
|
||||
needUpdate = this.behavior.updateBehavior(needUpdate);
|
||||
}
|
||||
return needUpdate;
|
||||
}
|
||||
@@ -197,16 +197,16 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
E entity = (E) eObj;
|
||||
if(!runnable.doesVortex(entity)) continue;
|
||||
if ((entity.isEntityAlive()) && (!entity.isEntityInvulnerable())) {
|
||||
double d = getDistanceTo(entity.posX, entity.posY, entity.posZ);
|
||||
double d = this.getDistanceTo(entity.posX, entity.posY, entity.posZ);
|
||||
if (d < 0.5D) { //prev: 2.0D
|
||||
Aspect a = runnable.getAspect(entity);
|
||||
if(a != null) {
|
||||
if (getAspects().getAmount(a) < getNodeVisBase(a)) {
|
||||
addToContainer(a, 1);
|
||||
if (this.getAspects().getAmount(a) < this.getNodeVisBase(a)) {
|
||||
this.addToContainer(a, 1);
|
||||
} else {
|
||||
//Adding it permanently
|
||||
if(!worldObj.isRemote && behavior.doesAccept(a)) {
|
||||
behavior.addAspect(runnable.getAspectType(entity), a, 1);
|
||||
if(!this.worldObj.isRemote && this.behavior.doesAccept(a)) {
|
||||
this.behavior.addAspect(runnable.getAspectType(entity), a, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,14 +214,14 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
entity.setDead();
|
||||
}
|
||||
}
|
||||
applyMovementVectors(entity);
|
||||
this.applyMovementVectors(entity);
|
||||
}
|
||||
}
|
||||
return needUpdate;
|
||||
}
|
||||
|
||||
public ExtendedNodeType getExtendedNodeType() {
|
||||
return extendedNodeType;
|
||||
return this.extendedNodeType;
|
||||
}
|
||||
|
||||
public void setExtendedNodeType(ExtendedNodeType extendedNodeType) {
|
||||
@@ -229,17 +229,17 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
}
|
||||
|
||||
public NBTTagCompound getBehaviorSnapshot() {
|
||||
if(extendedNodeType != null && extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
if(this.extendedNodeType != null && this.extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
NBTTagCompound behaviorCompound = new NBTTagCompound();
|
||||
behavior.writeToNBT(behaviorCompound);
|
||||
this.behavior.writeToNBT(behaviorCompound);
|
||||
return behaviorCompound;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void readBehaviorSnapshot(NBTTagCompound tagCompound) {
|
||||
if(tagCompound != null && extendedNodeType != null && extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
behavior.readFromNBT(tagCompound);
|
||||
if(tagCompound != null && this.extendedNodeType != null && this.extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
this.behavior.readFromNBT(tagCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,9 +256,9 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
this.extendedNodeType = null;
|
||||
}
|
||||
|
||||
if(extendedNodeType != null && extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
if(this.extendedNodeType != null && this.extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
NBTTagCompound growingNodeBehavior = compound.getCompoundTag("NodeBehavior");
|
||||
behavior.readFromNBT(growingNodeBehavior);
|
||||
this.behavior.readFromNBT(growingNodeBehavior);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,12 +268,12 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
if(extendedNodeType != null) {
|
||||
compound.setString("exNodeType", extendedNodeType.name());
|
||||
if(this.extendedNodeType != null) {
|
||||
compound.setString("exNodeType", this.extendedNodeType.name());
|
||||
|
||||
if(extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
if(this.extendedNodeType == ExtendedNodeType.GROWING) {
|
||||
NBTTagCompound behaviorCompound = new NBTTagCompound();
|
||||
behavior.writeToNBT(behaviorCompound);
|
||||
this.behavior.writeToNBT(behaviorCompound);
|
||||
compound.setTag("NodeBehavior", behaviorCompound);
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class TileExtendedNode extends TileNode implements INode {
|
||||
}
|
||||
|
||||
public void triggerVortexExplosion() {
|
||||
doingVortexExplosion = true;
|
||||
this.doingVortexExplosion = true;
|
||||
}
|
||||
|
||||
private abstract static class GrowingNodeVortexRunnable<E> {
|
||||
|
||||
@@ -34,15 +34,15 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
private AspectList aspects = new AspectList();
|
||||
private AspectList aspectsBase = new AspectList();
|
||||
private NodeType nodeType = NodeType.NORMAL;
|
||||
private NodeModifier nodeModifier = null;
|
||||
private ExtendedNodeType extendedNodeType = null;
|
||||
private NBTTagCompound behaviorSnapshot = null;
|
||||
private NodeModifier nodeModifier;
|
||||
private ExtendedNodeType extendedNodeType;
|
||||
private NBTTagCompound behaviorSnapshot;
|
||||
private String id = "";
|
||||
public long animate = 0L;
|
||||
public long animate;
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTexture() {
|
||||
return tex;
|
||||
return TileExtendedNodeJar.tex;
|
||||
}
|
||||
|
||||
public boolean canUpdate() {
|
||||
@@ -70,13 +70,13 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
} else {
|
||||
this.aspectsBase = al.copy();
|
||||
}
|
||||
setNodeType(NodeType.values()[nbttagcompound.getByte("type")]);
|
||||
this.setNodeType(NodeType.values()[nbttagcompound.getByte("type")]);
|
||||
byte mod = nbttagcompound.getByte("modifier");
|
||||
if(mod >= 0) setNodeModifier(NodeModifier.values()[mod]); else setNodeModifier(null);
|
||||
if(mod >= 0) this.setNodeModifier(NodeModifier.values()[mod]); else this.setNodeModifier(null);
|
||||
byte exType = nbttagcompound.getByte("extendedNodeType");
|
||||
if(exType >= 0) setExtendedNodeType(ExtendedNodeType.values()[exType]); else setExtendedNodeType(null);
|
||||
if(exType >= 0) this.setExtendedNodeType(ExtendedNodeType.values()[exType]); else this.setExtendedNodeType(null);
|
||||
if(nbttagcompound.hasKey("Behavior")) {
|
||||
behaviorSnapshot = nbttagcompound.getCompoundTag("Behavior");
|
||||
this.behaviorSnapshot = nbttagcompound.getCompoundTag("Behavior");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,11 +93,11 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
tlist.appendTag(f);
|
||||
}
|
||||
}
|
||||
nbttagcompound.setByte("type", (byte) getNodeType().ordinal());
|
||||
nbttagcompound.setByte("modifier", getNodeModifier() == null ? -1 : (byte) getNodeModifier().ordinal());
|
||||
nbttagcompound.setByte("extendedNodeType", getExtendedNodeType() == null ? -1 : (byte) getExtendedNodeType().ordinal());
|
||||
if(behaviorSnapshot != null) {
|
||||
nbttagcompound.setTag("Behavior", behaviorSnapshot);
|
||||
nbttagcompound.setByte("type", (byte) this.getNodeType().ordinal());
|
||||
nbttagcompound.setByte("modifier", this.getNodeModifier() == null ? -1 : (byte) this.getNodeModifier().ordinal());
|
||||
nbttagcompound.setByte("extendedNodeType", this.getExtendedNodeType() == null ? -1 : (byte) this.getExtendedNodeType().ordinal());
|
||||
if(this.behaviorSnapshot != null) {
|
||||
nbttagcompound.setTag("Behavior", this.behaviorSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
}
|
||||
this.aspects.add(tt, am - out);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
markDirty();
|
||||
this.markDirty();
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
if (this.aspects.getAmount(tt) >= am) {
|
||||
this.aspects.remove(tt, am);
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
markDirty();
|
||||
this.markDirty();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -140,10 +140,7 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
}
|
||||
|
||||
public boolean doesContainerContainAmount(Aspect tag, int amt) {
|
||||
if (this.aspects.getAmount(tag) >= amt) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return this.aspects.getAmount(tag) >= amt;
|
||||
}
|
||||
|
||||
public boolean doesContainerContain(AspectList ot) {
|
||||
@@ -176,7 +173,7 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
}
|
||||
|
||||
public ExtendedNodeType getExtendedNodeType() {
|
||||
return extendedNodeType;
|
||||
return this.extendedNodeType;
|
||||
}
|
||||
|
||||
public void setExtendedNodeType(ExtendedNodeType extendedNodeType) {
|
||||
@@ -200,7 +197,7 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
}
|
||||
|
||||
public NBTTagCompound getBehaviorSnapshot() {
|
||||
return behaviorSnapshot;
|
||||
return this.behaviorSnapshot;
|
||||
}
|
||||
|
||||
public void setNodeVisBase(Aspect aspect, short nodeVisBase) {
|
||||
@@ -236,12 +233,12 @@ public class TileExtendedNodeJar extends TileJarNode {
|
||||
world.setBlock(x, y, z, ConfigBlocks.blockAiry, 0, 3);
|
||||
TileExtendedNode tn = (TileExtendedNode) world.getTileEntity(x, y, z);
|
||||
if (tn != null) {
|
||||
tn.setAspects(getAspects());
|
||||
tn.setNodeModifier(getNodeModifier());
|
||||
tn.setNodeType(getNodeType());
|
||||
tn.setExtendedNodeType(getExtendedNodeType());
|
||||
new Injector(tn, TileNode.class).setField("id", getId());
|
||||
tn.readBehaviorSnapshot(getBehaviorSnapshot());
|
||||
tn.setAspects(this.getAspects());
|
||||
tn.setNodeModifier(this.getNodeModifier());
|
||||
tn.setNodeType(this.getNodeType());
|
||||
tn.setExtendedNodeType(this.getExtendedNodeType());
|
||||
new Injector(tn, TileNode.class).setField("id", this.getId());
|
||||
tn.readBehaviorSnapshot(this.getBehaviorSnapshot());
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
tn.markDirty();
|
||||
}
|
||||
|
||||
Loaded 100 of 246 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user