-nearly finished packager

-fixed golem core dupe bug
-added unfinished config option
This commit is contained in:
makeo committed 2015-11-29 20:04:48 +01:00
1 parent 5d366d08a4
commit 09e436fefe
10 files changed
+239 -6

No files matched your search

@@ -111,6 +111,9 @@ public class ClientProxy extends CommonProxy {
RenderTileBlockProtector renderTileBlockProtector = new RenderTileBlockProtector();
ClientRegistry.bindTileEntitySpecialRenderer(TileBlockProtector.class, renderTileBlockProtector);
RenderTileArcanePackager renderTileArcanePackager = new RenderTileArcanePackager();
ClientRegistry.bindTileEntitySpecialRenderer(TileArcanePackager.class, renderTileArcanePackager);
//Items
TileArcaneDropper fakeTile = new TileArcaneDropper();
fakeTile.blockMetadata = 8 | ForgeDirection.SOUTH.ordinal();
@@ -136,6 +139,7 @@ public class ClientProxy extends CommonProxy {
TileBlockProtector tileBlockProtector = new TileBlockProtector();
tileBlockProtector.facing = 3;
itemRenderStoneMachine.registerRenderer(2, tileBlockProtector, renderTileBlockProtector);
itemRenderStoneMachine.registerRenderer(4, new TileArcanePackager(), renderTileArcanePackager);
MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemFamiliar, new ItemRenderFamiliar());
MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemCreativeNode, new ItemCreativeNodeRenderer());
@@ -0,0 +1,105 @@
package makeo.gadomancy.client.models;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by makeo @ 28.11.2015 19:04
*/
public class ModelArcanePackager extends ModelBase {
ModelRenderer shape1;
ModelRenderer shape2;
ModelRenderer shape3;
ModelRenderer shape4;
ModelRenderer shape5;
ModelRenderer shape6;
ModelRenderer shape7;
ModelRenderer shape8;
ModelRenderer shape9;
public ModelArcanePackager() {
textureWidth = 64;
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);
}
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);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -0,0 +1,42 @@
package makeo.gadomancy.client.models;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by makeo @ 29.11.2015 12:36
*/
public class ModelPackagerPiston extends ModelBase {
ModelRenderer shape1;
ModelRenderer shape2;
public ModelPackagerPiston()
{
textureWidth = 64;
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;
shape2 = new ModelRenderer(this, 41, 0);
shape2.addBox(0F, 0F, 0F, 4, 4, 4);
shape2.setRotationPoint(-2F, 12F, -2F);
shape2.setTextureSize(64, 32);
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);
}
}
@@ -0,0 +1,65 @@
package makeo.gadomancy.client.renderers.tile;
import makeo.gadomancy.client.models.ModelArcanePackager;
import makeo.gadomancy.client.models.ModelPackagerPiston;
import makeo.gadomancy.common.blocks.tiles.TileArcanePackager;
import makeo.gadomancy.common.utils.SimpleResourceLocation;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumcraft.common.tiles.TileJarFillable;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by makeo @ 28.11.2015 19:08
*/
public class RenderTileArcanePackager extends TileEntitySpecialRenderer {
private static final ResourceLocation TEXTURE = new SimpleResourceLocation("/models/arcane_packager.png");
private static final ModelArcanePackager MODEL = new ModelArcanePackager();
private static final ResourceLocation TEXTURE_PISTON = new SimpleResourceLocation("/models/packager_piston.png");
private static final ModelPackagerPiston MODEL_PISTON = new ModelPackagerPiston();
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(180 , 1, 0, 0);
GL11.glTranslatef(0.5f, -1.5f, -0.5f);
GL11.glRotatef(-90*((TileJarFillable)tile).facing + 270, 0, 1, 0);
GL11.glPushMatrix();
float pistonOffset;
int pixelProgress = ((TileArcanePackager)tile).progress;
if(pixelProgress <= 40) {
pistonOffset = (pixelProgress / 40f) * (3/16f);
} else {
pixelProgress -= 41;
float progress = pixelProgress / 5f;
pistonOffset = (3/16f) - (progress * (3/16f));
}
GL11.glTranslatef(0, pistonOffset, 0);
bindTexture(TEXTURE_PISTON);
MODEL_PISTON.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bindTexture(TEXTURE);
MODEL.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
@@ -178,7 +178,7 @@ public class BlockStoneMachine extends Block {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase ent, ItemStack stack) {
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 2) {
if (metadata == 2 || metadata == 4) {
((TileJarFillable) world.getTileEntity(x, y, z)).facing = MathHelper.floor_double(-ent.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;
}
}
@@ -260,6 +260,8 @@ public class BlockStoneMachine extends Block {
setBlockBounds(0.25f, 0, 0.25f, 0.75f, 0.99f, 0.75f);
} else if(metadata == 2) {
setBlockBounds(0, 0, 0, 1, 3/16f, 1);
} else if(metadata == 4) {
setBlockBounds(0, 0, 0, 1, 12/16f, 1);
}
super.setBlockBoundsBasedOnState(world, x, y, z);
}
@@ -273,14 +273,24 @@ public class TileArcanePackager extends TileJarFillable implements IInventory, I
return true;
}
private static final int[] ORIENTATION_MAPPING = new int[]{-1, -1, 0, 2, 1, 3};
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
if(side == 0) {
return new int[]{11};
}
if(ORIENTATION_MAPPING[side] == super.facing) {
return new int[]{9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8};
}
return new int[0];
}
@Override
public boolean canInsertItem(int slot, ItemStack stack, int side) {
return true;
return !(useEssentia && (slot == 9 || slot == 10));
}
@Override
@@ -33,8 +33,9 @@ public class ModConfig {
public static int maxMazeCount = -1;
public static int renderParticleDistance = 100;
public static boolean enableAdditionalNodeTypes;
//Skyblock stuff
@Sync
public static boolean ancientStoneRecipes = false;
private ModConfig() {}
@@ -61,8 +62,9 @@ public class ModConfig {
doLightCalculations = config.getBoolean("calculateEldritchLight", "dimension", true, "TRUE = Calculating Light values for the Gadomancy-Eldritch Mazes; FALSE = No calculation, but some Light Bugs - Calculating the Light takes ~2 seconds -> Can be measured when trying to enter the eldritch mazed via Gadomancy Eldritch portal.");
maxMazeCount = config.getInt("maxMazeCount", "dimension", -1, -1, Integer.MAX_VALUE, "Defines how many Eldritch mazes may exist at the same time using the Gadomancy Eldritch ritual. (-1 = infinite) Note that 1 maze = 1 player; Once the player finishes the maze, the maze closes itself and teleports the player out.");
ancientStoneRecipes = config.getBoolean("ancientStoneRecipes", "skyblock", false, "TRUE = Adds recipes for Ancient Stone and Ancient Stone Pedestal (This may be usefull for severs and skyblock packs to craft the Node Manipulator and get more primodial pearls)");
ancientStoneRecipes = config.getBoolean("ancientStoneRecipes", "skyblock", false, "TRUE = Adds recipes for Ancient Stone and Ancient Stone Pedestal (This may be usefull for severs and skyblock packs to craft the Node Manipulator and get more primodial pearls). You have to change this client- and server-side!");
renderParticleDistance = config.getInt("particleRenderDistance", "general", 100, 5, 1000, "Defines, how close a player has to be towards the particle origin to see the particles created by it.");
enableAdditionalNodeTypes = config.getBoolean("disableAdditionalNodeTypes", "general", true, "Enables our custom node types. This might solve some compatibility issues (e.g. WitchingGadgets). You have to change this client- and server-side!");
}
}
@@ -214,9 +214,12 @@ public class EventHandlerGolem {
}
}
if(core != null) {
if(core != null && heldItem.stackSize > 0) {
GadomancyApi.setAdditionalGolemCore(golem, core);
event.setCanceled(true);
if(!event.entityPlayer.capabilities.isCreativeMode) {
heldItem.stackSize--;
}
}
}
} else {