mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-16 10:34:40 +00:00
Switch pain spots to using crossproxy
This commit is contained in:
5 files changed
+8
-6
No files matched your search
@@ -331,12 +331,11 @@ public class ClientProxy extends CommonProxy {
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if(entity == player) {
|
||||
if(!(mc.playerController instanceof IExtendedPlayerController)) {
|
||||
GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.CURRENT_GAME_TYPE);
|
||||
NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER);
|
||||
BotaniaPlayerController controller = new BotaniaPlayerController(mc, net);
|
||||
boolean isFlying = player.capabilities.isFlying;
|
||||
boolean allowFlying = player.capabilities.allowFlying;
|
||||
controller.setGameType(type);
|
||||
Botania.crossVersionProxy.copyGameType(mc.playerController, controller);
|
||||
player.capabilities.isFlying = isFlying;
|
||||
player.capabilities.allowFlying = allowFlying;
|
||||
mc.playerController = controller;
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.render.entity.RenderDoppleganger;
|
||||
import vazkii.botania.common.Botania;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -61,7 +62,7 @@ public class RenderTileGaiaHead extends TileEntitySkullRenderer {
|
||||
profile = ((EntityPlayer) mc.getRenderViewEntity()).getGameProfile();
|
||||
} else if (view instanceof EntitySkeleton) {
|
||||
skullType = 0;
|
||||
if(((EntitySkeleton) view).getSkeletonType() == 1)
|
||||
if(Botania.crossVersionProxy.getSkeletonTypeInt((EntitySkeleton) view) == 1)
|
||||
skullType = 1;
|
||||
} else if(view instanceof EntityWither)
|
||||
skullType = 1;
|
||||
|
||||
@@ -669,7 +669,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBoss {
|
||||
entity = new EntitySkeleton(worldObj);
|
||||
entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW));
|
||||
if(worldObj.rand.nextInt(8) == 0) {
|
||||
((EntitySkeleton) entity).setSkeletonType(1);
|
||||
Botania.crossVersionProxy.setSkeletonTypeInt((EntitySkeleton) entity, 1);
|
||||
entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(hard ? ModItems.elementiumSword : Items.STONE_SWORD));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.api.mana.ILaputaImmobile;
|
||||
import vazkii.botania.api.mana.ILensEffect;
|
||||
import vazkii.botania.api.mana.ITinyPlanetExcempt;
|
||||
import vazkii.botania.api.sound.BotaniaSoundEvents;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
@@ -250,7 +251,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
|
||||
TileEntity tile = null;
|
||||
NBTTagCompound tilecmp = ItemNBTHelper.getCompound(lens, TAG_TILE, false);
|
||||
if(tilecmp.hasKey("id"))
|
||||
tile = TileEntity.create(tilecmp);
|
||||
tile = Botania.crossVersionProxy.createTeFromCompound(entity.worldObj, tilecmp);
|
||||
|
||||
entity.worldObj.setBlockState(pos, block.getStateFromMeta(meta), 1 | 2);
|
||||
entity.worldObj.playEvent(2001, pos, Block.getStateId(block.getStateFromMeta(meta)));
|
||||
|
||||
+2
-1
@@ -14,6 +14,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -41,7 +42,7 @@ public class ItemElementiumAxe extends ItemManasteelAxe {
|
||||
int looting = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, weapon);
|
||||
|
||||
if(event.getEntityLiving() instanceof EntitySkeleton && rand.nextInt(26) <= 3 + looting)
|
||||
addDrop(event, new ItemStack(Items.SKULL, 1, ((EntitySkeleton)event.getEntityLiving()).getSkeletonType()));
|
||||
addDrop(event, new ItemStack(Items.SKULL, 1, Botania.crossVersionProxy.getSkeletonTypeInt((EntitySkeleton) event.getEntityLiving())));
|
||||
else if(event.getEntityLiving() instanceof EntityZombie && !(event.getEntityLiving() instanceof EntityPigZombie) && rand.nextInt(26) <= 2 + 2 * looting)
|
||||
addDrop(event, new ItemStack(Items.SKULL, 1, 2));
|
||||
else if(event.getEntityLiving() instanceof EntityCreeper && rand.nextInt(26) <= 2 + 2 * looting)
|
||||
|
||||
Reference in new issue
Block a user