mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Fixed server support, add fancy JEI crafting category items, fix transmitter internal retexturing, fixed SMP particles, fixed glass face culling, fixed laser beam render
This commit is contained in:
1 parent
c9f8fd011e
commit
bba29e64bb
13 files changed
+193
-162
No files matched your search
@@ -16,7 +16,7 @@ import mekanism.api.MekanismConfig.client;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.client.SparkleAnimation.INodeChecker;
|
||||
import mekanism.client.entity.EntityLaser;
|
||||
import mekanism.client.entity.ParticleLaser;
|
||||
import mekanism.client.gui.GuiAmbientAccumulator;
|
||||
import mekanism.client.gui.GuiBoilerStats;
|
||||
import mekanism.client.gui.GuiChemicalCrystallizer;
|
||||
@@ -115,10 +115,15 @@ import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine;
|
||||
import mekanism.common.block.BlockPlasticFence.PlasticFenceStateMapper;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.block.states.BlockStateCardboardBox.CardboardBoxStateMapper;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateOre.EnumOreType;
|
||||
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockStateMapper;
|
||||
import mekanism.common.entity.EntityBabySkeleton;
|
||||
import mekanism.common.entity.EntityBalloon;
|
||||
import mekanism.common.entity.EntityFlame;
|
||||
@@ -200,6 +205,7 @@ import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
@@ -250,6 +256,12 @@ public class ClientProxy extends CommonProxy
|
||||
"solar_neutron_activator", "chemical_dissolution_chamber", "chemical_crystallizer", "seismic_vibrator", "security_desk",
|
||||
"quantum_entangloporter", "resistive_heater", "EnergyCube", "digital_miner"};
|
||||
|
||||
private static final IStateMapper machineMapper = new MachineBlockStateMapper();
|
||||
private static final IStateMapper basicMapper = new BasicBlockStateMapper();
|
||||
private static final IStateMapper plasticMapper = new PlasticBlockStateMapper();
|
||||
private static final IStateMapper fenceMapper = new PlasticFenceStateMapper();
|
||||
private static final IStateMapper boxMapper = new CardboardBoxStateMapper();
|
||||
|
||||
@Override
|
||||
public void loadConfiguration()
|
||||
{
|
||||
@@ -418,6 +430,19 @@ public class ClientProxy extends CommonProxy
|
||||
@Override
|
||||
public void registerBlockRenders()
|
||||
{
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.MachineBlock, machineMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.MachineBlock2, machineMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.MachineBlock3, machineMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.BasicBlock, basicMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.BasicBlock2, basicMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.PlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.SlickPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.GlowPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.ReinforcedPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.RoadPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.PlasticFence, fenceMapper);
|
||||
ModelLoader.setCustomStateMapper(MekanismBlocks.CardboardBox, boxMapper);
|
||||
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(MekanismBlocks.ObsidianTNT), 0, new ModelResourceLocation("mekanism:ObsidianTNT", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(MekanismBlocks.SaltBlock), 0, new ModelResourceLocation("mekanism:SaltBlock", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(MekanismBlocks.CardboardBox), 0, new ModelResourceLocation("mekanism:CardboardBox", "storage=false"));
|
||||
@@ -1089,7 +1114,7 @@ public class ClientProxy extends CommonProxy
|
||||
@Override
|
||||
public void renderLaser(World world, Pos3D from, Pos3D to, EnumFacing direction, double energy)
|
||||
{
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityLaser(world, from, to, direction, energy));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleLaser(world, from, to, direction, energy));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
package mekanism.client.entity;
|
||||
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EntityLaser extends Particle
|
||||
{
|
||||
double length;
|
||||
EnumFacing direction;
|
||||
|
||||
public EntityLaser(World world, Pos3D start, Pos3D end, EnumFacing dir, double energy)
|
||||
{
|
||||
super(world, (start.xCoord + end.xCoord)/2D, (start.yCoord + end.yCoord)/2D, (start.zCoord+end.zCoord)/2D);
|
||||
particleMaxAge = 5;
|
||||
particleRed = 1;
|
||||
particleGreen = 0;
|
||||
particleBlue = 0;
|
||||
particleAlpha = 0.1F;
|
||||
particleScale = (float) Math.min(energy / 50000, 0.6);
|
||||
length = end.distance(start);
|
||||
direction = dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
|
||||
{
|
||||
worldRendererIn.finishDrawing();
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_POLYGON_BIT + GL11.GL_ENABLE_BIT);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
MekanismRenderer.glowOn();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("mekanism", "particles/laser.png"));
|
||||
|
||||
float newX = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
|
||||
float newY = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
|
||||
float newZ = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
|
||||
|
||||
GlStateManager.translate(newX, newY, newZ);
|
||||
|
||||
switch(direction)
|
||||
{
|
||||
case UP:
|
||||
case DOWN:
|
||||
default:
|
||||
break;
|
||||
case WEST:
|
||||
case EAST:
|
||||
GlStateManager.rotate(90, 0, 0, 1);
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(90, 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
GlStateManager.rotate(45, 0, 1, 0);
|
||||
worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
worldRendererIn.pos(-particleScale, -length/2, 0).tex(0, 0).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.pos(-particleScale, length/2, 0).tex(0, 1).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.pos(particleScale, length/2, 0).tex(1, 1).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.pos(particleScale, -length/2, 0).tex(1, 0).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.finishDrawing();
|
||||
|
||||
GlStateManager.rotate(90, 0, 1, 0);
|
||||
worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
worldRendererIn.pos(-particleScale, -length/2, 0).tex(0, 0).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.pos(-particleScale, length/2, 0).tex(0, 1).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.pos(particleScale, length/2, 0).tex(1, 1).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.pos(particleScale, -length/2, 0).tex(1, 0).color(particleRed, particleGreen, particleBlue, particleAlpha).endVertex();
|
||||
worldRendererIn.finishDrawing();
|
||||
|
||||
MekanismRenderer.glowOff();
|
||||
GL11.glPopAttrib();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package mekanism.client.entity;
|
||||
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ParticleLaser extends Particle
|
||||
{
|
||||
double length;
|
||||
EnumFacing direction;
|
||||
|
||||
public ParticleLaser(World world, Pos3D start, Pos3D end, EnumFacing dir, double energy)
|
||||
{
|
||||
super(world, (start.xCoord + end.xCoord)/2D, (start.yCoord + end.yCoord)/2D, (start.zCoord+end.zCoord)/2D);
|
||||
particleMaxAge = 5;
|
||||
particleRed = 1;
|
||||
particleGreen = 0;
|
||||
particleBlue = 0;
|
||||
particleAlpha = 0.1F;
|
||||
particleScale = (float) Math.min(energy / 50000, 0.6);
|
||||
length = end.distance(start);
|
||||
direction = dir;
|
||||
particleTexture = MekanismRenderer.laserIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_POLYGON_BIT + GL11.GL_ENABLE_BIT);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
MekanismRenderer.glowOn();
|
||||
|
||||
float newX = (float)(prevPosX + (posX - prevPosX) * (double)partialTicks - interpPosX);
|
||||
float newY = (float)(prevPosY + (posY - prevPosY) * (double)partialTicks - interpPosY);
|
||||
float newZ = (float)(prevPosZ + (posZ - prevPosZ) * (double)partialTicks - interpPosZ);
|
||||
|
||||
GlStateManager.translate(newX, newY, newZ);
|
||||
|
||||
switch(direction)
|
||||
{
|
||||
case UP:
|
||||
case DOWN:
|
||||
default:
|
||||
break;
|
||||
case WEST:
|
||||
case EAST:
|
||||
GlStateManager.rotate(90, 0, 0, 1);
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
GlStateManager.rotate(90, 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
float uMin = particleTexture.getInterpolatedU(0);
|
||||
float uMax = particleTexture.getInterpolatedU(16);
|
||||
float vMin = particleTexture.getInterpolatedV(0);
|
||||
float vMax = particleTexture.getInterpolatedV(16);
|
||||
|
||||
GlStateManager.rotate(45, 0, 1, 0);
|
||||
worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
|
||||
worldRendererIn.pos(-particleScale, -length/2, 0).tex(uMin, vMin).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
worldRendererIn.pos(-particleScale, length/2, 0).tex(uMin, vMax).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
worldRendererIn.pos(particleScale, length/2, 0).tex(uMax, vMax).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
worldRendererIn.pos(particleScale, -length/2, 0).tex(uMax, vMin).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
GlStateManager.rotate(90, 0, 1, 0);
|
||||
worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
|
||||
worldRendererIn.pos(-particleScale, -length/2, 0).tex(uMin, vMin).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
worldRendererIn.pos(-particleScale, length/2, 0).tex(uMin, vMax).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
worldRendererIn.pos(particleScale, length/2, 0).tex(uMax, vMax).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
worldRendererIn.pos(particleScale, -length/2, 0).tex(uMax, vMin).color(particleRed, particleGreen, particleBlue, particleAlpha).lightmap(240, 240).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
MekanismRenderer.glowOff();
|
||||
GL11.glPopAttrib();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
worldRendererIn.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,8 @@ import mekanism.client.jei.machine.other.ThermalEvaporationRecipeHandler;
|
||||
import mekanism.client.jei.machine.other.ThermalEvaporationRecipeWrapper;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.machines.BasicMachineRecipe;
|
||||
@@ -198,6 +200,23 @@ public class MekanismJEI implements IModPlugin
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<RotaryCondensentratorRecipeWrapper> condensentratorRecipes = new ArrayList<RotaryCondensentratorRecipeWrapper>();
|
||||
|
||||
RotaryCondensentratorRecipeCategory rotaryCondensentratorCategory = new RotaryCondensentratorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
|
||||
registry.addRecipeCategories(rotaryCondensentratorCategory);
|
||||
registry.addRecipeHandlers(new RotaryCondensentratorRecipeHandler(rotaryCondensentratorCategory));
|
||||
|
||||
for(Gas gas : GasRegistry.getRegisteredGasses())
|
||||
{
|
||||
if(gas.hasFluid())
|
||||
{
|
||||
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, true, rotaryCondensentratorCategory));
|
||||
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, false, rotaryCondensentratorCategory));
|
||||
}
|
||||
}
|
||||
|
||||
registry.addRecipes(condensentratorRecipes);
|
||||
|
||||
registry.addRecipeClickArea(GuiEnrichmentChamber.class, 79, 40, 24, 7, "mekanism.enrichment_chamber");
|
||||
registry.addRecipeClickArea(GuiCrusher.class, 79, 40, 24, 7, "mekanism.crusher");
|
||||
registry.addRecipeClickArea(GuiCombiner.class, 79, 40, 24, 7, "mekanism.combiner");
|
||||
@@ -218,22 +237,30 @@ public class MekanismJEI implements IModPlugin
|
||||
registry.addRecipeClickArea(GuiPRC.class, 75, 37, 36, 10, "mekanism.pressurized_reaction_chamber");
|
||||
registry.addRecipeClickArea(GuiRotaryCondensentrator.class, 64, 39, 48, 8, "mekanism.rotary_condensentrator");
|
||||
|
||||
List<RotaryCondensentratorRecipeWrapper> condensentratorRecipes = new ArrayList<RotaryCondensentratorRecipeWrapper>();
|
||||
registerRecipeItem(registry, MachineType.ENRICHMENT_CHAMBER);
|
||||
registerRecipeItem(registry, MachineType.CRUSHER);
|
||||
registerRecipeItem(registry, MachineType.COMBINER);
|
||||
registerRecipeItem(registry, MachineType.PURIFICATION_CHAMBER);
|
||||
registerRecipeItem(registry, MachineType.OSMIUM_COMPRESSOR);
|
||||
registerRecipeItem(registry, MachineType.CHEMICAL_INJECTION_CHAMBER);
|
||||
registerRecipeItem(registry, MachineType.PRECISION_SAWMILL);
|
||||
registerRecipeItem(registry, MachineType.METALLURGIC_INFUSER);
|
||||
registerRecipeItem(registry, MachineType.CHEMICAL_CRYSTALLIZER);
|
||||
registerRecipeItem(registry, MachineType.CHEMICAL_DISSOLUTION_CHAMBER);
|
||||
registerRecipeItem(registry, MachineType.CHEMICAL_INFUSER);
|
||||
registerRecipeItem(registry, MachineType.CHEMICAL_OXIDIZER);
|
||||
registerRecipeItem(registry, MachineType.CHEMICAL_WASHER);
|
||||
registerRecipeItem(registry, MachineType.SOLAR_NEUTRON_ACTIVATOR);
|
||||
registerRecipeItem(registry, MachineType.ELECTROLYTIC_SEPARATOR);
|
||||
registerRecipeItem(registry, MachineType.PRESSURIZED_REACTION_CHAMBER);
|
||||
registerRecipeItem(registry, MachineType.ROTARY_CONDENSENTRATOR);
|
||||
|
||||
RotaryCondensentratorRecipeCategory rotaryCondensentratorCategory = new RotaryCondensentratorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
|
||||
registry.addRecipeCategories(rotaryCondensentratorCategory);
|
||||
registry.addRecipeHandlers(new RotaryCondensentratorRecipeHandler(rotaryCondensentratorCategory));
|
||||
|
||||
for(Gas gas : GasRegistry.getRegisteredGasses())
|
||||
{
|
||||
if(gas.hasFluid())
|
||||
{
|
||||
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, true, rotaryCondensentratorCategory));
|
||||
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, false, rotaryCondensentratorCategory));
|
||||
}
|
||||
}
|
||||
|
||||
registry.addRecipes(condensentratorRecipes);
|
||||
registry.addRecipeCategoryCraftingItem(BasicBlockType.THERMAL_EVAPORATION_CONTROLLER.getStack(1), "mekanism.thermal_evaporation_plant");
|
||||
}
|
||||
|
||||
private void registerRecipeItem(IModRegistry registry, MachineType type)
|
||||
{
|
||||
registry.addRecipeCategoryCraftingItem(type.getStack(), "mekanism." + type.getName());
|
||||
}
|
||||
|
||||
private void registerBasicMachine(IModRegistry registry, Recipe recipe, String unlocalized, ProgressBar bar, Class<? extends MachineRecipeHandler> handler, Class<? extends MachineRecipeWrapper> wrapper) throws Exception
|
||||
|
||||
@@ -62,6 +62,7 @@ public class MekanismRenderer
|
||||
|
||||
public static TextureAtlasSprite energyIcon;
|
||||
public static TextureAtlasSprite heatIcon;
|
||||
public static TextureAtlasSprite laserIcon;
|
||||
|
||||
public static float GAS_RENDER_BASE = 0.2F;
|
||||
|
||||
@@ -101,6 +102,7 @@ public class MekanismRenderer
|
||||
|
||||
energyIcon = event.getMap().registerSprite(new ResourceLocation("mekanism:blocks/liquid/LiquidEnergy"));
|
||||
heatIcon = event.getMap().registerSprite(new ResourceLocation("mekanism:blocks/liquid/LiquidHeat"));
|
||||
laserIcon = event.getMap().registerSprite(new ResourceLocation("mekanism:blocks/Laser"));
|
||||
|
||||
event.getMap().registerSprite(new ResourceLocation("mekanism:blocks/liquid/LiquidHeavyWater"));
|
||||
|
||||
@@ -305,8 +307,8 @@ public class MekanismRenderer
|
||||
{
|
||||
int j = quad.getFormat().getIntegerSize() * i;
|
||||
int uvIndex = quad.getFormat().getUvOffsetById(0) / 4;
|
||||
vertices[j + uvIndex] = Float.floatToRawIntBits(sprite.getInterpolatedU(sprite.getUnInterpolatedU(Float.intBitsToFloat(vertices[j + uvIndex]))));
|
||||
vertices[j + uvIndex + 1] = Float.floatToRawIntBits(sprite.getInterpolatedV(sprite.getUnInterpolatedV(Float.intBitsToFloat(vertices[j + uvIndex + 1]))));
|
||||
vertices[j + uvIndex] = Float.floatToRawIntBits(sprite.getInterpolatedU(quad.getSprite().getUnInterpolatedU(Float.intBitsToFloat(vertices[j + uvIndex]))));
|
||||
vertices[j + uvIndex + 1] = Float.floatToRawIntBits(sprite.getInterpolatedV(quad.getSprite().getUnInterpolatedV(Float.intBitsToFloat(vertices[j + uvIndex + 1]))));
|
||||
}
|
||||
|
||||
return new BakedQuad(vertices, quad.getTintIndex(), quad.getFace(), sprite, quad.shouldApplyDiffuseLighting(), quad.getFormat());
|
||||
|
||||
@@ -112,7 +112,7 @@ public class RenderTickHandler
|
||||
}
|
||||
|
||||
Pos3D playerPos = new Pos3D(p).translate(0, 1.7, 0);
|
||||
|
||||
|
||||
float random = (rand.nextFloat() - 0.5F) * 0.1F;
|
||||
|
||||
Pos3D vLeft = new Pos3D(-0.43, -0.55, -0.54).rotatePitch(p.isSneaking() ? 20 : 0).rotateYaw(p.renderYawOffset);
|
||||
@@ -207,7 +207,7 @@ public class RenderTickHandler
|
||||
flameYCoord -= 0.5F;
|
||||
}
|
||||
else {
|
||||
flameYCoord += 1F;
|
||||
flameYCoord -= 0.5F;
|
||||
}
|
||||
|
||||
flameZCoord += 1.05F;
|
||||
|
||||
@@ -168,8 +168,6 @@ public class CommonProxy implements IGuiProvider
|
||||
GameRegistry.registerTileEntity(TileEntityBin.class, "Bin");
|
||||
GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner");
|
||||
GameRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter");
|
||||
GameRegistry.registerTileEntity(TileEntityChemicalOxidizer.class, "ChemicalOxidizer");
|
||||
GameRegistry.registerTileEntity(TileEntityChemicalInfuser.class, "ChemicalInfuser");
|
||||
GameRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber");
|
||||
GameRegistry.registerTileEntity(TileEntityThermalEvaporationController.class, "ThermalEvaporationController");
|
||||
GameRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill");
|
||||
|
||||
@@ -15,12 +15,7 @@ import mekanism.common.block.BlockObsidianTNT;
|
||||
import mekanism.common.block.BlockOre;
|
||||
import mekanism.common.block.BlockPlastic;
|
||||
import mekanism.common.block.BlockPlasticFence;
|
||||
import mekanism.common.block.BlockPlasticFence.PlasticFenceStateMapper;
|
||||
import mekanism.common.block.BlockSalt;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateCardboardBox.CardboardBoxStateMapper;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockType;
|
||||
import mekanism.common.item.ItemBlockBasic;
|
||||
import mekanism.common.item.ItemBlockCardboardBox;
|
||||
@@ -30,9 +25,7 @@ import mekanism.common.item.ItemBlockMachine;
|
||||
import mekanism.common.item.ItemBlockOre;
|
||||
import mekanism.common.item.ItemBlockPlastic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
@@ -58,12 +51,6 @@ public class MekanismBlocks
|
||||
public static Block PlasticFence = new BlockPlasticFence();
|
||||
public static Block SaltBlock = new BlockSalt();
|
||||
|
||||
private static final IStateMapper machineMapper = new MachineBlockStateMapper();
|
||||
private static final IStateMapper basicMapper = new BasicBlockStateMapper();
|
||||
private static final IStateMapper plasticMapper = new PlasticBlockStateMapper();
|
||||
private static final IStateMapper fenceMapper = new PlasticFenceStateMapper();
|
||||
private static final IStateMapper boxMapper = new CardboardBoxStateMapper();
|
||||
|
||||
/**
|
||||
* Adds and registers all blocks.
|
||||
*/
|
||||
@@ -106,19 +93,6 @@ public class MekanismBlocks
|
||||
GameRegistry.register(MekanismItems.init(new ItemBlockPlastic(RoadPlasticBlock), "RoadPlasticBlock"));
|
||||
GameRegistry.register(MekanismItems.init(new ItemBlockPlastic(PlasticFence), "PlasticFence"));
|
||||
GameRegistry.register(MekanismItems.init(new ItemBlock(SaltBlock), "SaltBlock"));
|
||||
|
||||
ModelLoader.setCustomStateMapper(MachineBlock, machineMapper);
|
||||
ModelLoader.setCustomStateMapper(MachineBlock2, machineMapper);
|
||||
ModelLoader.setCustomStateMapper(MachineBlock3, machineMapper);
|
||||
ModelLoader.setCustomStateMapper(BasicBlock, basicMapper);
|
||||
ModelLoader.setCustomStateMapper(BasicBlock2, basicMapper);
|
||||
ModelLoader.setCustomStateMapper(PlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(SlickPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(GlowPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(ReinforcedPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(RoadPlasticBlock, plasticMapper);
|
||||
ModelLoader.setCustomStateMapper(PlasticFence, fenceMapper);
|
||||
ModelLoader.setCustomStateMapper(CardboardBox, boxMapper);
|
||||
|
||||
Mekanism.proxy.registerBlockRenders();
|
||||
}
|
||||
|
||||
@@ -942,7 +942,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
{
|
||||
if(BasicBlockType.get(state) == BasicBlockType.STRUCTURAL_GLASS)
|
||||
{
|
||||
if(!ctmData[10][0].shouldRenderSide(world, pos, side))
|
||||
if(!ctmData[10][0].shouldRenderSide(world, pos.offset(side), side))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,12 @@ import mekanism.generators.client.render.RenderSolarGenerator;
|
||||
import mekanism.generators.client.render.RenderTurbineRotor;
|
||||
import mekanism.generators.client.render.RenderWindGenerator;
|
||||
import mekanism.generators.client.render.item.GeneratorItemModelFactory;
|
||||
import mekanism.generators.common.GeneratorsBlocks;
|
||||
import mekanism.generators.common.GeneratorsCommonProxy;
|
||||
import mekanism.generators.common.GeneratorsItems;
|
||||
import mekanism.generators.common.block.states.BlockStateGenerator.GeneratorBlockStateMapper;
|
||||
import mekanism.generators.common.block.states.BlockStateGenerator.GeneratorType;
|
||||
import mekanism.generators.common.block.states.BlockStateReactor.ReactorBlockStateMapper;
|
||||
import mekanism.generators.common.block.states.BlockStateReactor.ReactorBlockType;
|
||||
import mekanism.generators.common.tile.TileEntityAdvancedSolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityBioGenerator;
|
||||
@@ -47,6 +50,7 @@ import mekanism.generators.common.tile.turbine.TileEntityTurbineVent;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -67,6 +71,9 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy
|
||||
public static final String[] CUSTOM_RENDERS = new String[] {"heat_generator", "solar_generator", "bio_generator", "wind_generator",
|
||||
"gas_generator", "advanced_solar_generator"};
|
||||
|
||||
private static final IStateMapper generatorMapper = new GeneratorBlockStateMapper();
|
||||
private static final IStateMapper reactorMapper = new ReactorBlockStateMapper();
|
||||
|
||||
@Override
|
||||
public void registerSpecialTileEntities()
|
||||
{
|
||||
@@ -94,6 +101,10 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy
|
||||
@Override
|
||||
public void registerBlockRenders()
|
||||
{
|
||||
ModelLoader.setCustomStateMapper(GeneratorsBlocks.Generator, generatorMapper);
|
||||
ModelLoader.setCustomStateMapper(GeneratorsBlocks.Reactor, reactorMapper);
|
||||
ModelLoader.setCustomStateMapper(GeneratorsBlocks.ReactorGlass, reactorMapper);
|
||||
|
||||
for(GeneratorType type : GeneratorType.values())
|
||||
{
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(type.blockType.getBlock()), type.meta, new ModelResourceLocation("mekanismgenerators:" + type.getName(), "inventory"));
|
||||
|
||||
@@ -5,13 +5,9 @@ import static mekanism.generators.common.block.states.BlockStateReactor.ReactorB
|
||||
import static mekanism.generators.common.block.states.BlockStateReactor.ReactorBlock.REACTOR_GLASS;
|
||||
import mekanism.generators.common.block.BlockGenerator;
|
||||
import mekanism.generators.common.block.BlockReactor;
|
||||
import mekanism.generators.common.block.states.BlockStateGenerator.GeneratorBlockStateMapper;
|
||||
import mekanism.generators.common.block.states.BlockStateReactor.ReactorBlockStateMapper;
|
||||
import mekanism.generators.common.item.ItemBlockGenerator;
|
||||
import mekanism.generators.common.item.ItemBlockReactor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
@@ -21,9 +17,6 @@ public class GeneratorsBlocks
|
||||
public static final Block Generator = BlockGenerator.getGeneratorBlock(GENERATOR_BLOCK_1);
|
||||
public static final Block Reactor = BlockReactor.getReactorBlock(REACTOR_BLOCK);
|
||||
public static final Block ReactorGlass = BlockReactor.getReactorBlock(REACTOR_GLASS);
|
||||
|
||||
private static final IStateMapper generatorMapper = new GeneratorBlockStateMapper();
|
||||
private static final IStateMapper reactorMapper = new ReactorBlockStateMapper();
|
||||
|
||||
public static void register()
|
||||
{
|
||||
@@ -35,10 +28,6 @@ public class GeneratorsBlocks
|
||||
GameRegistry.register(GeneratorsItems.init(new ItemBlockReactor(Reactor), "Reactor"));
|
||||
GameRegistry.register(GeneratorsItems.init(new ItemBlockReactor(ReactorGlass), "ReactorGlass"));
|
||||
|
||||
ModelLoader.setCustomStateMapper(Generator, generatorMapper);
|
||||
ModelLoader.setCustomStateMapper(Reactor, reactorMapper);
|
||||
ModelLoader.setCustomStateMapper(ReactorGlass, reactorMapper);
|
||||
|
||||
MekanismGenerators.proxy.registerBlockRenders();
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ public abstract class BlockReactor extends BlockContainer implements ICTMBlock
|
||||
|
||||
if(type == ReactorBlockType.REACTOR_GLASS || type == ReactorBlockType.LASER_FOCUS_MATRIX)
|
||||
{
|
||||
if(!ctmData[meta].shouldRenderSide(world, pos, side))
|
||||
if(!ctmData[meta].shouldRenderSide(world, pos.offset(side), side))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user