Compare commits

..
Author SHA1 Message Date
nicksitnikov b198bd8568 Localize infusion toggle messages 2026-06-10 12:12:46 -05:00
nicksitnikov 5ebd91e844 Continue flattening code 2026-06-10 12:07:15 -05:00
nicksitnikov 0612173fc6 Mildly flatten code 2026-06-10 12:00:12 -05:00
nicksitnikov cfd2910120 Localize key bindings 2026-06-10 11:54:15 -05:00
8 changed files with 187 additions and 280 deletions

No files matched your search

@@ -8,8 +8,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -28,11 +26,10 @@ public class EntityEndersteed extends EntityHorse {
this.initialized = false;
}
@Override
public void readEntityFromNBT(final NBTTagCompound p_70037_1_) {
super.readEntityFromNBT(p_70037_1_);
if (!(this.initialized = p_70037_1_.getBoolean("initialized"))) {
final Multimap<String, AttributeModifier> map = HashMultimap.create();
final Multimap map = HashMultimap.create();
map.put("generic.movementSpeed", new AttributeModifier("generic.movementSpeed", 0.1, 1));
map.put("horse.jumpStrength", new AttributeModifier("horse.jumpStrength", 0.25, 1));
map.put("generic.maxHealth", new AttributeModifier("generic.maxHealth", 4.0, 1));
@@ -41,13 +38,11 @@ public class EntityEndersteed extends EntityHorse {
}
}
@Override
public void writeEntityToNBT(final NBTTagCompound p_70014_1_) {
super.writeEntityToNBT(p_70014_1_);
p_70014_1_.setBoolean("initialized", this.initialized);
}
@Override
public void setJumpPower(final int p_110206_1_) {
final double blocks = p_110206_1_ / 7.0;
this.teleportTo(
@@ -56,7 +51,6 @@ public class EntityEndersteed extends EntityHorse {
this.posZ + blocks * Math.cos(Math.toRadians(this.rotationYaw)));
}
@Override
public String getCommandSenderName() {
if (this.hasCustomNameTag()) {
return this.getCustomNameTag();
@@ -64,15 +58,6 @@ public class EntityEndersteed extends EntityHorse {
return StatCollector.translateToLocal("entity.ThaumicHorizons.Endersteed.name");
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.Endersteed.name");
}
}
protected boolean teleportTo(final double p_70825_1_, final double p_70825_3_, final double p_70825_5_) {
final EnderTeleportEvent event = new EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0.0f);
if (MinecraftForge.EVENT_BUS.post(event)) {
@@ -10,8 +10,6 @@ import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -28,27 +26,16 @@ public class EntityFamiliar extends EntityOcelot {
super(p_i1688_1_);
}
@Override
public String getCommandSenderName() {
return this.hasCustomNameTag() ? this.getCustomNameTag()
: (this.isTamed() ? StatCollector.translateToLocal("entity.ThaumicHorizons.Familiar.name")
: super.getCommandSenderName());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag() || !this.isTamed()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.Familiar.name");
}
}
@Override
public void updateAITick() {
super.updateAITick();
if (this.ticksExisted % 10 == 0) {
final List<EntityPlayer> players = this.worldObj.getEntitiesWithinAABB(
final List<EntityPlayer> players = (List<EntityPlayer>) this.worldObj.getEntitiesWithinAABB(
EntityPlayer.class,
AxisAlignedBB.getBoundingBox(
this.posX - 5.0,
@@ -22,11 +22,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
@@ -130,7 +128,6 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public boolean isValidTarget(final Entity target) {
if (!this.berserk) {
return super.isValidTarget(target) || target instanceof EntityCreeper;
@@ -140,7 +137,6 @@ public class EntityGolemTH extends EntityGolemBase {
&& !target.getCommandSenderName().equals(this.getCommandSenderName());
}
@Override
public boolean setupGolem() {
super.setupGolem();
if (this.getCore() == -1) {
@@ -172,7 +168,6 @@ public class EntityGolemTH extends EntityGolemBase {
return true;
}
@Override
public boolean attackEntityFrom(final DamageSource ds, float par2) {
this.paused = false;
if (ds == DamageSource.cactus) {
@@ -197,7 +192,6 @@ public class EntityGolemTH extends EntityGolemBase {
return super.attackEntityFrom(ds, par2);
}
@Override
public int getCarryLimit() {
int base = this.type.carry;
if (this.worldObj.isRemote) {
@@ -207,7 +201,6 @@ public class EntityGolemTH extends EntityGolemBase {
return base;
}
@Override
public float getAIMoveSpeed() {
if (this.paused || this.inactive) {
return 0.0f;
@@ -228,7 +221,6 @@ public class EntityGolemTH extends EntityGolemBase {
return speed;
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (!this.worldObj.isRemote) {
@@ -247,13 +239,37 @@ public class EntityGolemTH extends EntityGolemBase {
if (this.ticksExisted % 10 == 0 && this.worldObj.rand.nextInt(500) == 0) {
final EntityPlayer player = this.worldObj.getPlayerEntityByName(this.getOwnerName());
switch (this.voidCount) {
case 0, 1, 2 -> {
case 0 -> {
if (player != null) {
final ChatComponentTranslation message = new ChatComponentTranslation(
"thaumichorizons.golemWarning" + this.voidCount);
message.setChatStyle(
new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE).setItalic(true));
player.addChatMessage(message);
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.DARK_PURPLE
+ StatCollector
.translateToLocal("thaumichorizons.golemWarning1")));
break;
}
}
case 1 -> {
if (player != null) {
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.DARK_PURPLE
+ StatCollector
.translateToLocal("thaumichorizons.golemWarning2")));
break;
}
}
case 2 -> {
if (player != null) {
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.DARK_PURPLE
+ StatCollector
.translateToLocal("thaumichorizons.golemWarning3")));
break;
}
}
case 3 -> {
@@ -279,7 +295,7 @@ public class EntityGolemTH extends EntityGolemBase {
if (this.regenTimer <= 0) {
this.regenTimer = this.type.regenDelay;
if (this.decoration.contains("F")) {
this.regenTimer = (this.regenTimer * 2) / 3;
this.regenTimer *= (int) 0.66f;
}
if (!this.worldObj.isRemote && this.getHealth() < this.getMaxHealth()) {
this.worldObj.setEntityState(this, (byte) 5);
@@ -289,25 +305,23 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public boolean isWithinHomeDistance(final int par1, final int par2, final int par3) {
return this.getCore() == -1 || super.isWithinHomeDistance(par1, par2, par3);
}
@Override
public void setFire(final int par1) {
if (!this.type.fireResist) {
super.setFire(par1);
}
}
@Override
public void writeEntityToNBT(final NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setByte("GolemTypeTH", (byte) this.type.ordinal());
nbt.setByte("GolemType", (byte) EnumGolemType.FLESH.ordinal());
if (this.blocky != null) {
final String s = "block";
final Block blocky = this.blocky;
nbt.setInteger(s, Block.getIdFromBlock(this.blocky));
} else {
nbt.setInteger("block", 0);
@@ -320,21 +334,24 @@ public class EntityGolemTH extends EntityGolemBase {
nbt.setBoolean("explosive", this.kaboom);
}
@Override
public void readEntityFromNBT(final NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.type = EnumGolemTHType.getType(nbt.getByte("GolemTypeTH"));
final int upgradeSlots = this.type.upgrades + (this.advanced ? 1 : 0);
this.upgrades = new byte[this.type.upgrades + (this.advanced ? 1 : 0)];
final int ul = this.upgrades.length;
this.upgrades = nbt.getByteArray("upgrades");
if (upgradeSlots != this.upgrades.length) {
byte[] tt = Arrays.copyOf(this.upgrades, upgradeSlots);
if (this.upgrades.length < upgradeSlots) {
Arrays.fill(tt, this.upgrades.length, upgradeSlots, (byte) -1);
if (ul != this.upgrades.length) {
final byte[] tt = new byte[ul];
for (int a = 0; a < ul; ++a) {
tt[a] = -1;
}
for (int a = 0; a < this.upgrades.length; ++a) {
if (a < ul) {
tt[a] = this.upgrades[a];
}
}
this.upgrades = tt;
}
StringBuilder st = new StringBuilder();
for (final byte c : this.upgrades) {
st.append(Integer.toHexString(c));
@@ -351,7 +368,6 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
protected void damageEntity(final DamageSource ds, final float par2) {
if (ds.isFireDamage() && this.type.fireResist) {
return;
@@ -359,7 +375,6 @@ public class EntityGolemTH extends EntityGolemBase {
super.damageEntity(ds, par2);
}
@Override
public int getTotalArmorValue() {
int var1 = super.getTotalArmorValue() + this.type.armor;
if (this.decoration.contains("V")) {
@@ -469,6 +484,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance = PacketHandler.INSTANCE;
final Block blocky = this.blocky;
instance.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -500,6 +516,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance2 = PacketHandler.INSTANCE;
final Block blocky2 = this.blocky;
instance2.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -533,6 +550,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance3 = PacketHandler.INSTANCE;
final Block blocky3 = this.blocky;
instance3.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -566,6 +584,7 @@ public class EntityGolemTH extends EntityGolemBase {
this.md,
3);
final SimpleNetworkWrapper instance4 = PacketHandler.INSTANCE;
final Block blocky4 = this.blocky;
instance4.sendToAllAround(
new PacketFXBlocksplosion(
Block.getIdFromBlock(this.blocky),
@@ -586,10 +605,10 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public void writeSpawnData(final ByteBuf data) {
super.writeSpawnData(data);
if (this.blocky != null) {
final Block blocky = this.blocky;
data.writeInt(Block.getIdFromBlock(this.blocky));
} else {
data.writeInt(0);
@@ -601,7 +620,6 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public void readSpawnData(final ByteBuf data) {
super.readSpawnData(data);
this.blocky = Block.getBlockById(data.readInt());
@@ -612,38 +630,18 @@ public class EntityGolemTH extends EntityGolemBase {
}
}
@Override
public String getCommandSenderName() {
if (this.hasCustomNameTag()) {
return this.getCustomNameTag();
}
if (this.blocky == null || this.blocky == Blocks.air) {
return StatCollector.translateToLocal("entity.ThaumicHorizons.GolemTH.voidling.name");
}
return StatCollector.translateToLocalFormatted("entity.ThaumicHorizons.GolemTH.name", getBlockLangKey());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag()) {
return super.func_145748_c_();
}
if (this.blocky == null || this.blocky == Blocks.air) {
return new ChatComponentTranslation("entity.ThaumicHorizons.GolemTH.voidling.name");
}
return new ChatComponentTranslation("entity.ThaumicHorizons.GolemTH.name", getBlockLangKey());
}
private String getBlockLangKey() {
final ItemStack stack = new ItemStack(this.blocky, 1, this.md);
if (stack.getItem() != null) {
return stack.getUnlocalizedName();
return stack.getDisplayName() + " Golem";
}
return this.blocky.getUnlocalizedName();
if (this.blocky == null || this.blocky == Blocks.air) {
return "Voidling Golem";
}
return this.blocky.getLocalizedName() + " Golem";
}
public EnumGolemType getGolemType() {
@@ -17,9 +17,7 @@ import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -46,32 +44,20 @@ public class EntityGravekeeper extends EntityOcelot {
this.targetTasks.addTask(10, new EntityAINearestAttackableTarget(this, EntityInhabitedZombie.class, 0, false));
}
@Override
public boolean attackEntityAsMob(final Entity p_70652_1_) {
return (p_70652_1_ instanceof EntityLivingBase && ((EntityLivingBase) p_70652_1_).isEntityUndead())
|| p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 2.0f);
}
@Override
public String getCommandSenderName() {
return this.hasCustomNameTag() ? this.getCustomNameTag()
: (this.isTamed() ? StatCollector.translateToLocal("entity.ThaumicHorizons.Gravekeeper.name")
: super.getCommandSenderName());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag() || !this.isTamed()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.Gravekeeper.name");
}
}
@Override
public void updateAITick() {
super.updateAITick();
final List<EntityLivingBase> critters = this.worldObj.getEntitiesWithinAABB(
final List<EntityLivingBase> critters = (List<EntityLivingBase>) this.worldObj.getEntitiesWithinAABB(
EntityLivingBase.class,
AxisAlignedBB.getBoundingBox(
this.posX - 5.0,
@@ -100,14 +86,12 @@ public class EntityGravekeeper extends EntityOcelot {
}
}
@Override
protected void entityInit() {
super.entityInit();
final byte b0 = this.dataWatcher.getWatchableObjectByte(16);
this.dataWatcher.updateObject(16, (byte) (b0 | 0x4));
}
@Override
public boolean isTamed() {
return true;
}
@@ -23,9 +23,7 @@ import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -51,14 +49,12 @@ public class EntityGuardianPanther extends EntityOcelot implements IEntityInfuse
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(24.0);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5000000119209289);
}
@Override
public boolean interact(final EntityPlayer p_70085_1_) {
final ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() instanceof final ItemFood itemfood) {
@@ -74,45 +70,30 @@ public class EntityGuardianPanther extends EntityOcelot implements IEntityInfuse
return super.interact(p_70085_1_);
}
@Override
public boolean attackEntityAsMob(final Entity p_70652_1_) {
return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 6.0f);
}
@Override
public String getCommandSenderName() {
return this.hasCustomNameTag() ? this.getCustomNameTag()
: (this.isTamed() ? StatCollector.translateToLocal("entity.ThaumicHorizons.GuardianPanther.name")
: super.getCommandSenderName());
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag() || !this.isTamed()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.GuardianPanther.name");
}
}
@Override
public void updateAITick() {
super.updateAITick();
}
@Override
protected void entityInit() {
super.entityInit();
final byte b0 = this.dataWatcher.getWatchableObjectByte(16);
this.dataWatcher.updateObject(16, (byte) (b0 | 0x4));
}
@Override
public boolean isTamed() {
return true;
}
@Override
public void resetStats() {
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(24.0);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5000000119209289);
@@ -12,8 +12,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
@@ -128,16 +126,6 @@ public class EntityNightmare extends EntityEndersteed {
return StatCollector.translateToLocal("entity.ThaumicHorizons.NightmareTH.name");
}
@Override
public IChatComponent func_145748_c_() {
if (this.hasCustomNameTag()) {
return super.func_145748_c_();
} else {
return new ChatComponentTranslation("entity.ThaumicHorizons.NightmareTH.name");
}
}
@Override
public void onUpdate() {
final AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(
this.boundingBox.minX,
@@ -189,7 +177,6 @@ public class EntityNightmare extends EntityEndersteed {
}
}
@Override
public void setInWeb() {
this.isInWeb = false;
this.fallDistance = 0.0f;
@@ -10,7 +10,8 @@ import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.input.Keyboard;
@@ -32,6 +33,8 @@ import thaumcraft.api.nodes.IRevealer;
public class THKeyHandler {
private static final ChatStyle INFUSION_MESSAGE = new ChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(true);
public KeyBinding keyV;
public KeyBinding keyM;
public KeyBinding keyC;
@@ -48,10 +51,19 @@ public class THKeyHandler {
public static long lastPressV;
public THKeyHandler() {
this.keyV = new KeyBinding("Change Arcane Lens", Keyboard.KEY_NONE, "Thaumcraft");
this.keyM = new KeyBinding("Activate Morphic Fingers", Keyboard.KEY_NONE, "Thaumcraft");
this.keyC = new KeyBinding("Toggle Spider Climb", Keyboard.KEY_NONE, "Thaumcraft");
this.keyX = new KeyBinding("Toggle Chameleon Skin", Keyboard.KEY_NONE, "Thaumcraft");
this.keyV = new KeyBinding(
"thaumichorizons.key.arcane_lens",
Keyboard.KEY_NONE,
"thaumichorizons.keybind_group");
this.keyM = new KeyBinding(
"thaumichorizons.key.morphic_fingers",
Keyboard.KEY_NONE,
"thaumichorizons.keybind_group");
this.keyC = new KeyBinding(
"thaumichorizons.key.spider_climb",
Keyboard.KEY_NONE,
"thaumichorizons.keybind_group");
this.keyX = new KeyBinding("thaumichorizons.key.chameleon", Keyboard.KEY_NONE, "thaumichorizons.keybind_group");
this.keyPressedM = false;
this.keyPressedC = false;
this.keyPressedX = false;
@@ -65,158 +77,122 @@ public class THKeyHandler {
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void playerTick(final TickEvent.PlayerTickEvent event) {
if (event.side == Side.SERVER) {
return;
}
if (event.phase == TickEvent.Phase.START) {
if (this.keyV.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
final EntityPlayer player = event.player;
if (player != null) {
if (!this.keyPressedV) {
THKeyHandler.lastPressV = System.currentTimeMillis();
THKeyHandler.radialLock = false;
}
if (!THKeyHandler.radialLock && player.inventory.armorItemInSlot(3) != null
&& player.inventory.armorItemInSlot(3).getItem() instanceof IRevealer) {
if (player.isSneaking()) {
PacketHandler.INSTANCE.sendToServer(new PacketLensChangeToServer(player, "REMOVE"));
} else {
THKeyHandler.radialActive = true;
}
}
}
this.keyPressedV = true;
}
} else {
THKeyHandler.radialActive = false;
if (this.keyPressedV) {
if (event.side != Side.CLIENT || event.phase != TickEvent.Phase.START || event.player == null) return;
final EntityPlayer player = event.player;
final EntityInfusionProperties infusions = (EntityInfusionProperties) player
.getExtendedProperties("CreatureInfusion");
if (this.keyV.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
if (!this.keyPressedV) {
THKeyHandler.lastPressV = System.currentTimeMillis();
THKeyHandler.radialLock = false;
}
this.keyPressedV = false;
}
if (this.keyM.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
final EntityPlayer player = event.player;
if (player != null) {
if (!this.keyPressedM) {
THKeyHandler.lastPressM = System.currentTimeMillis();
}
if (((EntityInfusionProperties) player.getExtendedProperties("CreatureInfusion"))
.hasPlayerInfusion(2) && !this.keyPressedM) {
player.openGui(
ThaumicHorizons.instance,
9,
player.worldObj,
(int) player.posX,
(int) player.posY,
(int) player.posZ);
PacketHandler.INSTANCE.sendToServer(new PacketFingersToServer(player, player.dimension));
}
if (!THKeyHandler.radialLock && player.inventory.armorItemInSlot(3) != null
&& player.inventory.armorItemInSlot(3).getItem() instanceof IRevealer) {
if (player.isSneaking()) {
PacketHandler.INSTANCE.sendToServer(new PacketLensChangeToServer(player, "REMOVE"));
} else {
THKeyHandler.radialActive = true;
}
this.keyPressedM = true;
}
} else {
if (this.keyPressedM) {
this.keyPressedV = true;
}
} else {
THKeyHandler.radialActive = false;
if (this.keyPressedV) {
THKeyHandler.lastPressV = System.currentTimeMillis();
}
this.keyPressedV = false;
}
if (this.keyM.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
if (!this.keyPressedM) {
THKeyHandler.lastPressM = System.currentTimeMillis();
}
this.keyPressedM = false;
}
if (this.keyC.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
final EntityPlayer player = event.player;
if (player != null) {
if (!this.keyPressedC) {
THKeyHandler.lastPressC = System.currentTimeMillis();
}
if (((EntityInfusionProperties) player.getExtendedProperties("CreatureInfusion"))
.hasPlayerInfusion(9) && !this.keyPressedC) {
((EntityInfusionProperties) player.getExtendedProperties(
"CreatureInfusion")).toggleClimb = !((EntityInfusionProperties) player
.getExtendedProperties("CreatureInfusion")).toggleClimb;
if (((EntityInfusionProperties) player
.getExtendedProperties("CreatureInfusion")).toggleClimb) {
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.GRAY
+ "Spider Climb disabled."));
} else {
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.GRAY
+ "Spider Climb enabled."));
}
PacketHandler.INSTANCE
.sendToServer(new PacketToggleClimbToServer(player, player.dimension));
}
}
this.keyPressedC = true;
if (infusions.hasPlayerInfusion(2) && !this.keyPressedM) {
player.openGui(
ThaumicHorizons.instance,
9,
player.worldObj,
(int) player.posX,
(int) player.posY,
(int) player.posZ);
PacketHandler.INSTANCE.sendToServer(new PacketFingersToServer(player, player.dimension));
}
} else {
if (this.keyPressedC) {
this.keyPressedM = true;
}
} else {
if (this.keyPressedM) {
THKeyHandler.lastPressM = System.currentTimeMillis();
}
this.keyPressedM = false;
}
if (this.keyC.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
if (!this.keyPressedC) {
THKeyHandler.lastPressC = System.currentTimeMillis();
}
this.keyPressedC = false;
}
if (this.keyX.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
final EntityPlayer player = event.player;
if (player != null) {
if (!this.keyPressedX) {
THKeyHandler.lastPressX = System.currentTimeMillis();
}
if (((EntityInfusionProperties) player.getExtendedProperties("CreatureInfusion"))
.hasPlayerInfusion(10) && !this.keyPressedX) {
((EntityInfusionProperties) player.getExtendedProperties(
"CreatureInfusion")).toggleInvisible = !((EntityInfusionProperties) player
.getExtendedProperties("CreatureInfusion")).toggleInvisible;
if (((EntityInfusionProperties) player
.getExtendedProperties("CreatureInfusion")).toggleInvisible) {
player.removePotionEffectClient(Potion.invisibility.id);
player.setInvisible(false);
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.GRAY
+ "Chameleon Skin disabled."));
} else {
final PotionEffect effect = new PotionEffect(
Potion.invisibility.id,
Integer.MAX_VALUE,
0,
true);
effect.setCurativeItems(new ArrayList<>());
player.addPotionEffect(effect);
player.setInvisible(true);
player.addChatMessage(
new ChatComponentText(
EnumChatFormatting.ITALIC + ""
+ EnumChatFormatting.GRAY
+ "Chameleon Skin enabled."));
}
PacketHandler.INSTANCE
.sendToServer(new PacketToggleInvisibleToServer(player, player.dimension));
}
if (infusions.hasPlayerInfusion(9) && !this.keyPressedC) {
infusions.toggleClimb = !infusions.toggleClimb;
if (infusions.toggleClimb) {
player.addChatMessage(
new ChatComponentTranslation("selfInfusions.spiderClimb.disable")
.setChatStyle(INFUSION_MESSAGE));
} else {
player.addChatMessage(
new ChatComponentTranslation("selfInfusions.spiderClimb.enable")
.setChatStyle(INFUSION_MESSAGE));
}
this.keyPressedX = true;
PacketHandler.INSTANCE.sendToServer(new PacketToggleClimbToServer(player, player.dimension));
}
} else {
if (this.keyPressedX) {
this.keyPressedC = true;
}
} else {
if (this.keyPressedC) {
THKeyHandler.lastPressC = System.currentTimeMillis();
}
this.keyPressedC = false;
}
if (this.keyX.getIsKeyPressed()) {
if (FMLClientHandler.instance().getClient().inGameHasFocus) {
if (!this.keyPressedX) {
THKeyHandler.lastPressX = System.currentTimeMillis();
}
this.keyPressedX = false;
if (infusions.hasPlayerInfusion(10) && !this.keyPressedX) {
infusions.toggleInvisible = !infusions.toggleInvisible;
if (infusions.toggleInvisible) {
player.removePotionEffectClient(Potion.invisibility.id);
player.setInvisible(false);
player.addChatMessage(
new ChatComponentTranslation("selfInfusions.chameleonSkin.disable")
.setChatStyle(INFUSION_MESSAGE));
} else {
final PotionEffect effect = new PotionEffect(
Potion.invisibility.id,
Integer.MAX_VALUE,
0,
true);
effect.setCurativeItems(new ArrayList<>());
player.addPotionEffect(effect);
player.setInvisible(true);
player.addChatMessage(
new ChatComponentTranslation("selfInfusions.chameleonSkin.enable")
.setChatStyle(INFUSION_MESSAGE));
}
PacketHandler.INSTANCE.sendToServer(new PacketToggleInvisibleToServer(player, player.dimension));
}
this.keyPressedX = true;
}
} else {
if (this.keyPressedX) {
THKeyHandler.lastPressX = System.currentTimeMillis();
}
this.keyPressedX = false;
}
}
static {
THKeyHandler.lastPressM = 0L;
THKeyHandler.lastPressC = 0L;
THKeyHandler.lastPressX = 0L;
THKeyHandler.radialActive = false;
THKeyHandler.radialLock = false;
THKeyHandler.lastPressV = 0L;
}
}
@@ -1,5 +1,11 @@
itemGroup.thaumichorizons=Thaumic Horizons
thaumichorizons.keybind_group=Thaumic Horizons
thaumichorizons.key.arcane_lens=Change Arcane Lens
thaumichorizons.key.morphic_fingers=Activate Morphic Fingers
thaumichorizons.key.spider_climb=Toggle Spider Climb
thaumichorizons.key.chameleon=Toggle Chameleon Skin
thaumichorizons.noJar=You need an empty warded jar to capture a creature!
thaumichorizons.setBeacon=Soul beacon set!
thaumichorizons.startSitting=is waiting.
@@ -55,6 +61,11 @@ selfInfusions.warpedTumor=Self: Warped Tumor
selfInfusions.spiderClimb=Self: Spider Climb
selfInfusions.chameleonSkin=Self: Chameleon Skin
selfInfusions.spiderClimb.enable=Spider Climb enabled.
selfInfusions.spiderClimb.disable=Spider Climb disabled.
selfInfusions.chameleonSkin.enable=Chameleon Skin enabled.
selfInfusions.chameleonSkin.disable=Chameleon Skin disabled.
###ENTITIES###
entity.ThaumicHorizons.PrimedAlchemite.name=Primed Alchemite
@@ -87,8 +98,6 @@ entity.ThaumicHorizons.VoltSlime.name=Volt Slime
entity.ThaumicHorizons.MedSlime.name=Medslime
entity.ThaumicHorizons.Sheeder.name=Sheeder
entity.ThaumicHorizons.LostSoul.name=Lost Soul
entity.ThaumicHorizons.GolemTH.name=%s Golem
entity.ThaumicHorizons.GolemTH.voidling.name=Voidling Golem
###POTIONS###