mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Bauble multiplayer fixes. Fixes crashing with the new aesthetics and fixes renders that use the head location on other players.
This commit is contained in:
1 parent
fb884fb225
commit
13df493efb
3 files changed
+12
-4
No files matched your search
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
@@ -26,7 +27,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
* This class doesn't extend IBauble to make the API not depend on the Baubles
|
||||
* API, but the item in question still needs to implement IBauble.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IBaubleRender {
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ public interface IBaubleRender {
|
||||
}
|
||||
|
||||
public static void translateToHeadLevel(EntityPlayer player) {
|
||||
GL11.glTranslated(0, -player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
|
||||
GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemKnockbackBelt extends ItemBaubleModifier implements IBaubleRender {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_KNOCKBACK_BELT);
|
||||
private static final ModelBiped model = new ModelBiped();
|
||||
private static ModelBiped model;
|
||||
|
||||
public ItemKnockbackBelt() {
|
||||
super(LibItemNames.KNOCKBACK_BELT);
|
||||
@@ -64,6 +64,10 @@ public class ItemKnockbackBelt extends ItemBaubleModifier implements IBaubleRend
|
||||
|
||||
float s = (armor ? 1.3F : 1.05F) / 16F;
|
||||
GL11.glScalef(s, s, s);
|
||||
|
||||
if(model == null)
|
||||
model = new ModelBiped();
|
||||
|
||||
model.bipedBody.render(1F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemTravelBelt extends ItemBauble implements IBaubleRender {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TRAVEL_BELT);
|
||||
private static final ModelBiped model = new ModelBiped();
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static ModelBiped model;
|
||||
|
||||
final float speed;
|
||||
final float jump;
|
||||
@@ -113,6 +114,9 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender {
|
||||
|
||||
float s = (armor ? 1.3F : 1.05F) / 16F;
|
||||
GL11.glScalef(s, s, s);
|
||||
if(model == null)
|
||||
model = new ModelBiped();
|
||||
|
||||
model.bipedBody.render(1F);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user