Skip to content
This repository was archived by the owner on Jan 25, 2020. It is now read-only.

Commit bfea827

Browse files
author
kevin68
committed
Update 2.2.3
1 parent 3ffff5b commit bfea827

File tree

9 files changed

+133
-77
lines changed

9 files changed

+133
-77
lines changed

build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mc=1.6.4
55
forge=9.11.1.916
66

77
#Nanotech Mod
8-
ntm_version=2.2.3-dev
8+
ntm_version=2.2.3
99

1010
ffmtlib_build=40
1111
ffmtlib_name=FFMT-libs-src-1.2.0.40-mc1.6.4.zip

common/fr/mcnanotech/kevin_68/nanotechmod/city/client/renderer/tileentity/TileEntitySpotLightRender.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@SideOnly(Side.CLIENT)
1616
public class TileEntitySpotLightRender extends TileEntitySpecialRenderer
1717
{
18-
protected static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png");
18+
private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png");
1919

2020
public void renderTileEntitySpotLightAt(TileEntitySpotLight tileentity, double x, double y, double z, float par8)
2121
{

common/fr/mcnanotech/kevin_68/nanotechmod/compatibility/core/NanotechModCompatibility.java

-27
This file was deleted.

common/fr/mcnanotech/kevin_68/nanotechmod/compatibility/core/forgemultipart/Utils/UtilMicroBlocks.java

-31
This file was deleted.

common/fr/mcnanotech/kevin_68/nanotechmod/main/client/renderer/items/ItemBlockPortableChestRender.java

+49-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package fr.mcnanotech.kevin_68.nanotechmod.main.client.renderer.items;
22

33
import net.minecraft.client.Minecraft;
4+
import net.minecraft.client.entity.AbstractClientPlayer;
5+
import net.minecraft.client.model.ModelBiped;
46
import net.minecraft.client.renderer.entity.RenderItem;
57
import net.minecraft.entity.Entity;
68
import net.minecraft.entity.player.EntityPlayer;
@@ -18,11 +20,15 @@
1820
public class ItemBlockPortableChestRender implements IItemRenderer
1921
{
2022
public final ModelPortableChest model;
23+
public final ModelBiped modelB;
2124
protected static final ResourceLocation texture = new ResourceLocation("nanotechmod", "textures/blocks/portablechest.png");
22-
25+
protected static ResourceLocation player;
26+
private static final ResourceLocation steveTextures = new ResourceLocation("textures/entity/steve.png");
27+
2328
public ItemBlockPortableChestRender()
2429
{
2530
model = new ModelPortableChest();
31+
modelB = new ModelBiped();
2632
}
2733

2834
@Override
@@ -79,11 +85,46 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data)
7985
GL11.glPushMatrix();
8086
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
8187
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
82-
GL11.glRotatef(-25F, 0.0F, 0.0F, 1.0F);
83-
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
84-
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
88+
GL11.glRotatef(-30F, 0.0F, 0.0F, 1.0F);
89+
GL11.glRotatef(-86.9F, 0.0F, 1.0F, 0.0F);
90+
GL11.glTranslatef(0.9F, -0.8F, -1.8F);
91+
GL11.glScaled(1.5F, 1.5F, 1.5F);
8592
model.render(0.0625F);
8693
GL11.glPopMatrix();
94+
95+
GL11.glPushMatrix();
96+
if(((AbstractClientPlayer)((Entity)data[1])).getLocationSkin() != null)
97+
{
98+
player = ((AbstractClientPlayer)((Entity)data[1])).getLocationSkin();
99+
}
100+
else
101+
{
102+
player = steveTextures;
103+
}
104+
Minecraft.getMinecraft().renderEngine.bindTexture(player);
105+
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
106+
GL11.glRotatef(-120F, 0.0F, 0.0F, 1.0F);
107+
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
108+
GL11.glTranslatef(2.0F, 0.5F, 0.2F);
109+
modelB.bipedRightArm.render(0.0625F);
110+
GL11.glPopMatrix();
111+
112+
GL11.glPushMatrix();
113+
if(((AbstractClientPlayer)((Entity)data[1])).getLocationSkin() != null)
114+
{
115+
player = ((AbstractClientPlayer)((Entity)data[1])).getLocationSkin();
116+
}
117+
else
118+
{
119+
player = steveTextures;
120+
}
121+
Minecraft.getMinecraft().renderEngine.bindTexture(player);
122+
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
123+
GL11.glRotatef(-120F, 0.0F, 0.0F, 1.0F);
124+
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
125+
GL11.glTranslatef(-0.32F, 0.5F, 0.2F);
126+
modelB.bipedLeftArm.render(0.0625F);
127+
GL11.glPopMatrix();
87128
break;
88129
}
89130
case ENTITY:
@@ -92,17 +133,13 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data)
92133
{
93134
GL11.glPushMatrix();
94135
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
95-
GL11.glRotatef(0, 1.0F, 0.0F, 0.0F);
96-
GL11.glTranslatef(0.4F, 0.2F, 0.0F);
97-
GL11.glScalef(2.0F, 2.0F, 2.0F);
98-
GL11.glScalef(0.3F, 0.3F, 0.3F);
99-
GL11.glTranslatef(-0.7F, 0.2F, 0.1F);
136+
GL11.glTranslatef(0.2F, -1.25F, 0.0F);
137+
GL11.glScalef(1.4F, 1.4F, 1.4F);
100138
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
101-
model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
139+
model.render(0.0625F);
102140
GL11.glPopMatrix();
141+
break;
103142
}
104-
break;
105-
106143
}
107144
default:
108145
break;

common/fr/mcnanotech/kevin_68/nanotechmod/main/client/renderer/tileentity/TileEntityPortableChestRender.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ public TileEntityPortableChestRender()
2828
@Override
2929
public void renderInventory(double x, double y, double z)
3030
{
31-
this.renderTileEntityAtPortableChest(null, x, y, z, 0);
31+
this.renderTileEntityAtPortableChest(null, x, y, z, 0, true);
3232
}
3333

3434
@Override
3535
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float tick)
3636
{
37-
this.renderTileEntityAtPortableChest((TileEntityPortableChest)tileentity, x, y, z, tick);
37+
this.renderTileEntityAtPortableChest((TileEntityPortableChest)tileentity, x, y, z, tick, false);
3838
}
3939

40-
public void renderTileEntityAtPortableChest(TileEntityPortableChest tePortableChest, double x, double y, double z, float tick)
40+
public void renderTileEntityAtPortableChest(TileEntityPortableChest tePortableChest, double x, double y, double z, float tick, boolean isInv)
4141
{
4242
GL11.glPushMatrix();
4343
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
4444
this.bindTexture(texture);
4545
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
46-
if(tePortableChest != null)
46+
if(tePortableChest != null && !isInv)
4747
{
4848
GL11.glRotatef(180F + 90F * tePortableChest.getDirection(), 0.0F, 1.0F, 0.0F);
4949
float angle = tePortableChest.prevLidAngle + (tePortableChest.lidAngle - tePortableChest.prevLidAngle) * tick;

common/fr/mcnanotech/kevin_68/nanotechmod/main/utils/NanotechServerTickHandler.java

+75
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55

66
import net.minecraft.entity.player.EntityPlayer;
77
import net.minecraft.item.ItemStack;
8+
import net.minecraft.nbt.NBTTagCompound;
9+
import net.minecraft.nbt.NBTTagList;
10+
import net.minecraft.tileentity.TileEntity;
11+
import net.minecraft.util.MathHelper;
812
import cpw.mods.fml.common.ITickHandler;
913
import cpw.mods.fml.common.Loader;
1014
import cpw.mods.fml.common.TickType;
15+
import fr.mcnanotech.kevin_68.nanotechmod.main.blocks.NanotechBlock;
1116
import fr.mcnanotech.kevin_68.nanotechmod.main.items.NanotechItem;
1217
import fr.mcnanotech.kevin_68.nanotechmod.main.other.NanotechDamageSource;
18+
import fr.mcnanotech.kevin_68.nanotechmod.main.tileentity.TileEntityPortableChest;
1319
import fr.mcnanotech.kevin_68.nanotechmod.ultimateGraviSuite.core.UltimateGraviSuite;
1420

1521
public class NanotechServerTickHandler implements ITickHandler
@@ -65,6 +71,75 @@ else if(player.inventory.armorItemInSlot(3) != null && player.inventory.armorIte
6571
}
6672
}
6773
}
74+
75+
for(int i = 0; i < player.inventory.getSizeInventory(); i++)
76+
{
77+
if(player.inventory.getStackInSlot(i) != null)
78+
{
79+
if(player.inventory.getStackInSlot(i).itemID == NanotechBlock.machine.blockID && player.inventory.getStackInSlot(i).getItemDamage() == 0)
80+
{
81+
if(player.inventory.getCurrentItem() != player.inventory.getStackInSlot(i))
82+
{
83+
int direction = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
84+
85+
int x = (int)player.posX;
86+
int y = (int)player.posY;
87+
int z = (int)player.posZ;
88+
89+
for(int g = -3; g != 3; g++)
90+
{
91+
for(int h = -3; h != 3; h++)
92+
{
93+
for(int f = -3; f != 3; f++)
94+
{
95+
if(player.worldObj.isAirBlock((int)player.posX + h, (int)player.posY + f, (int)player.posZ + g))
96+
{
97+
x = (int)player.posX + h;
98+
y = (int)player.posY + f;
99+
z = (int)player.posZ + g;
100+
}
101+
}
102+
}
103+
}
104+
105+
while(player.worldObj.isAirBlock(x, y -1, z) && y > 0)
106+
{
107+
y--;
108+
}
109+
110+
player.worldObj.setBlock(x, y, z, NanotechBlock.machine.blockID, 0, 2);
111+
TileEntity te = player.worldObj.getBlockTileEntity(x, y, z);
112+
if(te != null && te instanceof TileEntityPortableChest)
113+
{
114+
TileEntityPortableChest teChest = (TileEntityPortableChest)te;
115+
teChest.setDirection((byte)direction);
116+
117+
if(player.inventory.getStackInSlot(i).hasTagCompound())
118+
{
119+
if(player.inventory.getStackInSlot(i).hasDisplayName())
120+
{
121+
teChest.setCustomGuiName(player.inventory.getStackInSlot(i).getDisplayName());
122+
}
123+
124+
NBTTagList nbttaglist = player.inventory.getStackInSlot(i).getTagCompound().getTagList("Items");
125+
for(int j = 0; j < nbttaglist.tagCount(); j++)
126+
{
127+
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(j);
128+
int k = nbttagcompound1.getByte("Slot");
129+
130+
if(k >= 0 && k < teChest.inventory.length)
131+
{
132+
teChest.inventory[k] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
133+
}
134+
}
135+
}
136+
}
137+
player.inventory.decrStackSize(i, 1);
138+
player.worldObj.markBlockForUpdate(x, y, z);
139+
}
140+
}
141+
}
142+
}
68143
}
69144

70145
private boolean doEffect(EntityPlayer player)

resources/assets/nanotechmodcity/lang/en_US.lang

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tile.modernFence.name=Modern Fence
1010
tile.sunShade.name=SunShade
1111
tile.lamp.name=Lamp
1212
tile.textSpotLight.name=Text Spotlight
13+
tile.machine.portableChest.name=Portable Chest
1314

1415
#Items
1516
item.configCopier.name=Config copier

resources/assets/nanotechmodcity/lang/fr_FR.lang

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ tile.fountain.name=Fontaine
99
tile.modernFence.name=Barrière Moderne
1010
tile.sunShade.name=Parasol
1111
tile.lamp.name=Lampadaire
12-
tile.textSpotLight.name=Projecteur de texte
12+
tile.textSpotLight.name=Projecteur de Texte
13+
tile.machine.portableChest.name=Coffre Portable
1314

1415
#Items
1516
item.configCopier.name=Copieur de configuration

0 commit comments

Comments
 (0)