Compare commits

..
13 changed files with 381 additions and 568 deletions

No files matched your search

+1 -3
View File
@@ -4,7 +4,5 @@ dependencies {
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.548:dev') {transitive = false}
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.0:dev')
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev')
}
@@ -228,7 +228,6 @@ import com.kentington.thaumichorizons.common.tiles.TileVortexStabilizer;
import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@@ -240,9 +239,6 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GTOreDictUnificator;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -2073,94 +2069,37 @@ public class ThaumicHorizons {
4,
new ResourceLocation("thaumichorizons", "textures/misc/pocketplane.png"));
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi")) {
recipeKeystone = ThaumcraftApi.addInfusionCraftingRecipe(
"pocketPlane",
new ItemStack(itemKeystone),
12,
(new AspectList()).add(Aspect.TRAVEL, 128).add(Aspect.VOID, 64).add(Aspect.EXCHANGE, 48)
.add(Aspect.AURA, 32).add(Aspect.MIND, 16).add(Aspect.ELDRITCH, 64),
new ItemStack(itemPlanarConduit),
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 6),
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L),
new ItemStack(ConfigItems.itemShard, 1, 6),
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L),
new ItemStack(ConfigItems.itemShard, 1, 6),
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L),
new ItemStack(ConfigItems.itemShard, 1, 6),
GTOreDictUnificator.get(OrePrefixes.gemExquisite, Materials.Glass, 1L),
GTOreDictUnificator.get(OrePrefixes.lens, Materials.InfusedOrder, 1L) });
recipeKeystone1 = ThaumcraftApi.addInfusionCraftingRecipe(
"planarKeystone",
new ItemStack(itemKeystone),
9,
(new AspectList()).add(Aspect.TRAVEL, 64).add(Aspect.VOID, 48).add(Aspect.MECHANISM, 32)
.add(Aspect.ELDRITCH, 32),
new ItemStack(Items.ender_eye),
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(ConfigItems.itemResource, 1, 3),
GTOreDictUnificator.get(OrePrefixes.lens, Materials.Glass, 1L),
new ItemStack(ConfigItems.itemResource, 1, 3),
new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(ConfigItems.itemResource, 1, 3),
GTOreDictUnificator.get(OrePrefixes.lens, Materials.Glass, 1L),
new ItemStack(ConfigItems.itemResource, 1, 3) });
recipeSlot = ThaumcraftApi.addInfusionCraftingRecipe(
"planarKeystone",
new ItemStack(blockSlot),
12,
(new AspectList()).add(Aspect.VOID, 48).add(Aspect.TRAVEL, 64).add(Aspect.AIR, 64)
.add(Aspect.MECHANISM, 32).add(Aspect.ELDRITCH, 64).add(Aspect.MAGIC, 16),
new ItemStack(itemPlanarConduit),
new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Enderium, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.InfusedGold, 1L),
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.InfusedGold, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Void, 1L),
GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Enderium, 1L),
GTOreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L) });
} else {
recipeKeystone = ThaumcraftApi.addInfusionCraftingRecipe(
"pocketPlane",
new ItemStack(itemKeystone),
6,
(new AspectList()).add(Aspect.TRAVEL, 32).add(Aspect.VOID, 32).add(Aspect.EXCHANGE, 16),
new ItemStack(itemPlanarConduit),
new ItemStack[] { new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6) });
recipeKeystone1 = ThaumcraftApi.addInfusionCraftingRecipe(
"planarKeystone",
new ItemStack(itemKeystone),
6,
(new AspectList()).add(Aspect.TRAVEL, 24).add(Aspect.VOID, 24).add(Aspect.ELDRITCH, 12),
new ItemStack(Items.diamond),
new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 3),
new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(ConfigItems.itemResource, 1, 3),
new ItemStack(ConfigItems.itemShard, 1, 6) });
recipeSlot = ThaumcraftApi.addInfusionCraftingRecipe(
"planarKeystone",
new ItemStack(blockSlot),
8,
(new AspectList()).add(Aspect.VOID, 32).add(Aspect.TRAVEL, 24).add(Aspect.MECHANISM, 24)
.add(Aspect.ELDRITCH, 24),
new ItemStack(itemPlanarConduit),
new ItemStack[] { new ItemStack(Items.gold_ingot),
new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot),
new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot),
new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot),
new ItemStack(ConfigItems.itemResource, 1, 16) });
}
recipeKeystone = ThaumcraftApi.addInfusionCraftingRecipe(
"pocketPlane",
new ItemStack(itemKeystone),
6,
(new AspectList()).add(Aspect.TRAVEL, 32).add(Aspect.VOID, 32).add(Aspect.EXCHANGE, 16),
new ItemStack(itemPlanarConduit),
new ItemStack[] { new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6),
new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 6) });
recipeKeystone1 = ThaumcraftApi.addInfusionCraftingRecipe(
"planarKeystone",
new ItemStack(itemKeystone),
6,
(new AspectList()).add(Aspect.TRAVEL, 24).add(Aspect.VOID, 24).add(Aspect.ELDRITCH, 12),
new ItemStack(Items.diamond),
new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 3),
new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 3),
new ItemStack(ConfigItems.itemShard, 1, 6) });
recipeSlot = ThaumcraftApi.addInfusionCraftingRecipe(
"planarKeystone",
new ItemStack(blockSlot),
8,
(new AspectList()).add(Aspect.VOID, 32).add(Aspect.TRAVEL, 24).add(Aspect.MECHANISM, 24)
.add(Aspect.ELDRITCH, 24),
new ItemStack(itemPlanarConduit),
new ItemStack[] { new ItemStack(Items.gold_ingot), new ItemStack(ConfigItems.itemResource, 1, 16),
new ItemStack(Items.gold_ingot), new ItemStack(ConfigItems.itemResource, 1, 16),
new ItemStack(Items.gold_ingot), new ItemStack(ConfigItems.itemResource, 1, 16),
new ItemStack(Items.gold_ingot), new ItemStack(ConfigItems.itemResource, 1, 16) });
ThaumcraftApi.addWarpToResearch("pocketPlane", 4);
ThaumcraftApi.addWarpToResearch("planarKeystone", 5);
@@ -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;
@@ -4,7 +4,10 @@
package com.kentington.thaumichorizons.common.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
@@ -43,6 +46,11 @@ public class ItemSyringeEmpty extends Item {
return this.icon;
}
@SideOnly(Side.CLIENT)
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
par3List.add(new ItemStack(this, 1, 2));
}
public String getUnlocalizedName(final ItemStack par1ItemStack) {
return "item.syringeEmpty";
}
@@ -35,7 +35,9 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.NoiseGeneratorOctaves;
import com.kentington.thaumichorizons.common.ThaumicHorizons;
@@ -78,6 +80,17 @@ public class PocketPlaneData {
return a.intValue() > a.floatValue() ? a.intValue() - 1 : a.intValue();
}
/**
* Sets the block directly in the chunk for significant performance boost
*/
private static void setBlock(World world, int x, int y, int z, Block blockIn, int metadataIn) {
WorldServer server = (WorldServer) world;
Chunk chunk = server.theChunkProviderServer.loadChunk(x >> 4, z >> 4);
chunk.func_150807_a(x & 15, y, z & 15, blockIn, metadataIn);
chunk.setChunkModified();
}
// TODO: Make pocket planes generate chunk-by-chunk using normal chunk generation
public static void generatePocketPlane(final AspectList aspects, final PocketPlaneData data, final World world,
final int vortexX, final int vortexY, final int vortexZ, final int returnID) {
if (!world.isRemote) {
@@ -106,12 +119,12 @@ public class PocketPlaneData {
drawSphere(xCenter, yCenter, zCenter, data.radius, ThaumicHorizons.blockVoid, 0, world);
for (int x = -2; x <= 2; ++x) {
for (int z = -2; z <= 2; ++z) {
world.setBlock(xCenter + x, yCenter, zCenter + z, ConfigBlocks.blockCosmeticSolid, 6, 0);
setBlock(world, xCenter + x, yCenter, zCenter + z, ConfigBlocks.blockCosmeticSolid, 6);
world.setBlockToAir(xCenter + x, yCenter + 1, zCenter + z);
world.setBlockToAir(xCenter + x, yCenter + 2, zCenter + z);
}
}
world.setBlock(xCenter, yCenter + 1, zCenter, ThaumicHorizons.blockVortex);
setBlock(world, xCenter, yCenter + 1, zCenter, ThaumicHorizons.blockVortex, 0);
TileEntity te = world.getTileEntity(xCenter, yCenter + 1, zCenter);
if (!(te instanceof TileVortex)) {
te = new TileVortex();
@@ -332,6 +345,7 @@ public class PocketPlaneData {
level -= fastFloor((aspectFraction(Aspect.CLOTH, aspects) * data.radius));
drewAnything = true;
}
if (aspects.getAmount(Aspect.EARTH) > 0) {
if (bio == BiomeGenBase.desert) {
drawLayer(xCenter, yCenter, zCenter, data, world, Blocks.sand, 0, level, noise, bio, life, aspects);
@@ -427,13 +441,13 @@ public class PocketPlaneData {
if (top != bottom && level + y > 0) {
if (y == top) {
if (block != null) {
world.setBlock(x + xCenter, y + level, z + zCenter, block, md, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, block, md);
}
if (block == Blocks.water) {
if (bio != null && bio.getTempCategory() == BiomeGenBase.TempCategory.COLD) {
world.setBlock(x + xCenter, y + level, z + zCenter, Blocks.ice, 0, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, Blocks.ice, 0);
} else {
world.setBlock(x + xCenter, y + level, z + zCenter, block, 0, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, block, 0);
if ((life > 40 || aspects.getAmount(Aspect.BEAST) > 0)
&& world.rand.nextInt(100) > 98
&& creatures < MAX_CREATURES) {
@@ -444,199 +458,199 @@ public class PocketPlaneData {
++creatures;
}
if (life > 0 && world.rand.nextInt(100) > 98) {
world.setBlock(x + xCenter, y + level + 1, z + zCenter, Blocks.waterlily, 0, 0);
setBlock(world, x + xCenter, y + level + 1, z + zCenter, Blocks.waterlily, 0);
}
}
} else if (block == Blocks.dirt) {
if (life > 0 && world.isAirBlock(x + xCenter, y + level + 1, z + zCenter)) {
world.setBlock(x + xCenter, y + level, z + zCenter, Blocks.grass, 0, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, Blocks.grass, 0);
if (life >= 10) {
if ((life >= 20 || aspects.getAmount(Aspect.CROP) > 0
|| aspects.getAmount(Aspect.HARVEST) > 0)
&& world.rand.nextInt(100) > 97) {
switch (world.rand.nextInt(10)) {
case 0 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level,
z + zCenter,
Blocks.farmland,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.carrots,
0,
0);
}
case 1 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level,
z + zCenter,
Blocks.farmland,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.potatoes,
0,
0);
}
case 2 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level,
z + zCenter,
Blocks.farmland,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.wheat,
0,
0);
}
case 3 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.melon_block,
0,
0);
}
case 4 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.pumpkin,
0,
0);
}
case 5 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.reeds,
0,
0);
}
case 6 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level,
z + zCenter,
Blocks.mycelium,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.red_mushroom,
0,
0);
}
case 7 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level,
z + zCenter,
Blocks.mycelium,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.brown_mushroom,
0,
0);
}
case 8 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockCustomPlant,
2,
0);
2);
}
case 9 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockCustomPlant,
5,
0);
5);
}
}
} else if ((life >= 15 || aspects.getAmount(Aspect.TREE) > 0)
&& world.rand.nextInt(100) > 97) {
switch (world.rand.nextInt(10)) {
case 0 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.sapling,
0,
0);
}
case 1 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.sapling,
1,
0);
1);
}
case 2 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.sapling,
2,
0);
2);
}
case 3 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.sapling,
3,
0);
3);
}
case 4 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.sapling,
4,
0);
4);
}
case 5 -> {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.sapling,
5,
0);
5);
}
case 6 -> {
if (((bio != null
@@ -644,24 +658,24 @@ public class PocketPlaneData {
|| aspects.getAmount(Aspect.MAGIC) > 10
|| aspects.getAmount(Aspect.AURA) > 5)
&& world.rand.nextInt(4) == 0) {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockCustomPlant,
1,
0);
1);
break;
}
}
case 7 -> {
if (world.rand.nextInt(3) == 0) {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockCustomPlant,
0,
0);
break;
}
@@ -672,40 +686,40 @@ public class PocketPlaneData {
&& world.rand.nextInt(100) > 94) {
final int random = world.rand.nextInt(18);
if (random <= 15) {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.red_flower,
random,
0);
random);
} else {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
Blocks.tallgrass,
random - 16,
0);
random - 16);
}
}
}
} else {
world.setBlock(x + xCenter, y + level, z + zCenter, block, 0, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, block, 0);
}
} else if (block == Blocks.sand) {
world.setBlock(x + xCenter, y + level, z + zCenter, block, 0, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, block, 0);
if (life > 10) {
if (life >= 20 && world.rand.nextInt(100) > 98) {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockCustomPlant,
3,
0);
3);
} else if (world.rand.nextInt(100) > 97) {
world.setBlock(x + xCenter, y + level + 1, z + zCenter, Blocks.cactus, 0, 0);
setBlock(world, x + xCenter, y + level + 1, z + zCenter, Blocks.cactus, 0);
}
}
} else if (block == ConfigBlocks.blockTaint && md == 2 && world.rand.nextInt(300) > 298) {
@@ -713,12 +727,12 @@ public class PocketPlaneData {
for (int ecks = 0; ecks < 3; ++ecks) {
for (int zee = 0; zee < 2; ++zee) {
for (int why = 0; why < 2; ++why) {
world.setBlock(
setBlock(
world,
x + xCenter + ecks,
y + level + why,
z + zCenter + zee,
ThaumicHorizons.blockBrain,
0,
0);
}
}
@@ -727,12 +741,12 @@ public class PocketPlaneData {
for (int ecks = 0; ecks < 2; ++ecks) {
for (int zee = 0; zee < 3; ++zee) {
for (int why = 0; why < 2; ++why) {
world.setBlock(
setBlock(
world,
x + xCenter + ecks,
y + level + why,
z + zCenter + zee,
ThaumicHorizons.blockBrain,
0,
0);
}
}
@@ -741,7 +755,7 @@ public class PocketPlaneData {
}
if (bio != null && block.isNormalCube()
&& bio.getTempCategory() == BiomeGenBase.TempCategory.COLD) {
world.setBlock(x + xCenter, y + level + 1, z + zCenter, Blocks.snow_layer, 1, 0);
setBlock(world, x + xCenter, y + level + 1, z + zCenter, Blocks.snow_layer, 1);
}
if ((life >= 50 || aspects.getAmount(Aspect.BEAST) > 0) && world.rand.nextInt(100) > 98) {
EntityLiving critter = null;
@@ -799,52 +813,46 @@ public class PocketPlaneData {
++creatures;
}
if (aspects.getAmount(Aspect.ELDRITCH) > 0 && world.rand.nextInt(200) > 198) {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level,
z + zCenter,
ConfigBlocks.blockCosmeticSolid,
1,
0);
world.setBlock(
1);
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockCosmeticSolid,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 2,
z + zCenter,
ConfigBlocks.blockCosmeticSolid,
0,
0);
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 3,
z + zCenter,
ConfigBlocks.blockCosmeticSolid,
0,
0);
}
if (aspects.getAmount(Aspect.CRAFT) > 0 && world.rand.nextInt(200) > 198) {
world.setBlock(
setBlock(
world,
x + xCenter,
y + level + 1,
z + zCenter,
ConfigBlocks.blockStoneDevice,
1,
0);
1);
}
if (aspects.getAmount(Aspect.TAINT) > 0 && world.rand.nextInt(100) > 98) {
world.setBlock(
x + xCenter,
y + level,
z + zCenter,
ConfigBlocks.blockTaintFibres,
0,
0);
setBlock(world, x + xCenter, y + level, z + zCenter, ConfigBlocks.blockTaintFibres, 0);
}
if (aspects.getAmount(Aspect.TAINT) > 0 && world.rand.nextInt(200) > 198
&& creatures < MAX_CREATURES) {
@@ -861,7 +869,7 @@ public class PocketPlaneData {
++creatures;
}
} else if (block != null) {
world.setBlock(x + xCenter, y + level, z + zCenter, block, md, 0);
setBlock(world, x + xCenter, y + level, z + zCenter, block, md);
}
}
}
@@ -988,114 +996,114 @@ public class PocketPlaneData {
yCenter + yOffset + y,
zCenter - zSize + zOffset + z) != Blocks.water) {
if (whichAspect == Aspect.EARTH) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
ConfigBlocks.blockCrystal,
3,
0);
3);
} else if (whichAspect == Aspect.AIR) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
ConfigBlocks.blockCrystal,
0,
0);
} else if (whichAspect == Aspect.WATER) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
ConfigBlocks.blockCrystal,
2,
0);
2);
} else if (whichAspect == Aspect.FIRE) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
ConfigBlocks.blockCrystal,
1,
0);
1);
} else if (whichAspect == Aspect.ORDER) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
ConfigBlocks.blockCrystal,
4,
0);
4);
} else if (whichAspect == Aspect.ENTROPY) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
ConfigBlocks.blockCrystal,
5,
0);
5);
} else if (whichAspect == Aspect.DEATH || whichAspect == Aspect.UNDEAD) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.skull,
0,
0);
} else if (whichAspect == Aspect.SENSES) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.lapis_block,
0,
0);
} else if (whichAspect == Aspect.GREED) {
if (world.rand.nextBoolean()) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.gold_block,
0,
0);
} else {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.emerald_block,
0,
0);
}
} else if (whichAspect == Aspect.METAL) {
if (world.rand.nextBoolean()) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.gold_block,
0,
0);
} else {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.iron_block,
0,
0);
}
}
}
} else {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
Blocks.air,
0,
0);
}
}
@@ -1395,13 +1403,13 @@ public class PocketPlaneData {
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z) != Blocks.water) {
world.setBlock(
setBlock(
world,
xCenter - xSize + xOffset + x,
yCenter + yOffset + y,
zCenter - zSize + zOffset + z,
block,
md,
0);
md);
}
}
}
@@ -1478,38 +1486,38 @@ public class PocketPlaneData {
int z = 0;
int radiusError = error0;
while (x >= z) {
world.setBlock(x0 + x, y0 + y1, z0 + z, block, md, 0);
world.setBlock(x0 + z, y0 + y1, z0 + x, block, md, 0);
world.setBlock(x0 - x, y0 + y1, z0 + z, block, md, 0);
world.setBlock(x0 - z, y0 + y1, z0 + x, block, md, 0);
world.setBlock(x0 - x, y0 + y1, z0 - z, block, md, 0);
world.setBlock(x0 - z, y0 + y1, z0 - x, block, md, 0);
world.setBlock(x0 + x, y0 + y1, z0 - z, block, md, 0);
world.setBlock(x0 + z, y0 + y1, z0 - x, block, md, 0);
world.setBlock(x0 + x, y0 - y1, z0 + z, block, md, 0);
world.setBlock(x0 + z, y0 - y1, z0 + x, block, md, 0);
world.setBlock(x0 - x, y0 - y1, z0 + z, block, md, 0);
world.setBlock(x0 - z, y0 - y1, z0 + x, block, md, 0);
world.setBlock(x0 - x, y0 - y1, z0 - z, block, md, 0);
world.setBlock(x0 - z, y0 - y1, z0 - x, block, md, 0);
world.setBlock(x0 + x, y0 - y1, z0 - z, block, md, 0);
world.setBlock(x0 + z, y0 - y1, z0 - x, block, md, 0);
world.setBlock(x0 + y1, y0 + x, z0 + z, block, md, 0);
world.setBlock(x0 + z, y0 + x, z0 + y1, block, md, 0);
world.setBlock(x0 - y1, y0 + x, z0 + z, block, md, 0);
world.setBlock(x0 - z, y0 + x, z0 + y1, block, md, 0);
world.setBlock(x0 + y1, y0 + x, z0 - z, block, md, 0);
world.setBlock(x0 + z, y0 + x, z0 - y1, block, md, 0);
world.setBlock(x0 - y1, y0 + x, z0 - z, block, md, 0);
world.setBlock(x0 - z, y0 + x, z0 - y1, block, md, 0);
world.setBlock(x0 + y1, y0 - x, z0 + z, block, md, 0);
world.setBlock(x0 + z, y0 - x, z0 + y1, block, md, 0);
world.setBlock(x0 - y1, y0 - x, z0 + z, block, md, 0);
world.setBlock(x0 - z, y0 - x, z0 + y1, block, md, 0);
world.setBlock(x0 + y1, y0 - x, z0 - z, block, md, 0);
world.setBlock(x0 + z, y0 - x, z0 - y1, block, md, 0);
world.setBlock(x0 - y1, y0 - x, z0 - z, block, md, 0);
world.setBlock(x0 - z, y0 - x, z0 - y1, block, md, 0);
setBlock(world, x0 + x, y0 + y1, z0 + z, block, md);
setBlock(world, x0 + z, y0 + y1, z0 + x, block, md);
setBlock(world, x0 - x, y0 + y1, z0 + z, block, md);
setBlock(world, x0 - z, y0 + y1, z0 + x, block, md);
setBlock(world, x0 - x, y0 + y1, z0 - z, block, md);
setBlock(world, x0 - z, y0 + y1, z0 - x, block, md);
setBlock(world, x0 + x, y0 + y1, z0 - z, block, md);
setBlock(world, x0 + z, y0 + y1, z0 - x, block, md);
setBlock(world, x0 + x, y0 - y1, z0 + z, block, md);
setBlock(world, x0 + z, y0 - y1, z0 + x, block, md);
setBlock(world, x0 - x, y0 - y1, z0 + z, block, md);
setBlock(world, x0 - z, y0 - y1, z0 + x, block, md);
setBlock(world, x0 - x, y0 - y1, z0 - z, block, md);
setBlock(world, x0 - z, y0 - y1, z0 - x, block, md);
setBlock(world, x0 + x, y0 - y1, z0 - z, block, md);
setBlock(world, x0 + z, y0 - y1, z0 - x, block, md);
setBlock(world, x0 + y1, y0 + x, z0 + z, block, md);
setBlock(world, x0 + z, y0 + x, z0 + y1, block, md);
setBlock(world, x0 - y1, y0 + x, z0 + z, block, md);
setBlock(world, x0 - z, y0 + x, z0 + y1, block, md);
setBlock(world, x0 + y1, y0 + x, z0 - z, block, md);
setBlock(world, x0 + z, y0 + x, z0 - y1, block, md);
setBlock(world, x0 - y1, y0 + x, z0 - z, block, md);
setBlock(world, x0 - z, y0 + x, z0 - y1, block, md);
setBlock(world, x0 + y1, y0 - x, z0 + z, block, md);
setBlock(world, x0 + z, y0 - x, z0 + y1, block, md);
setBlock(world, x0 - y1, y0 - x, z0 + z, block, md);
setBlock(world, x0 - z, y0 - x, z0 + y1, block, md);
setBlock(world, x0 + y1, y0 - x, z0 - z, block, md);
setBlock(world, x0 + z, y0 - x, z0 - y1, block, md);
setBlock(world, x0 - y1, y0 - x, z0 - z, block, md);
setBlock(world, x0 - z, y0 - x, z0 - y1, block, md);
++z;
if (radiusError < 0) {
radiusError += 2 * z + 1;
@@ -1636,7 +1644,7 @@ public class PocketPlaneData {
if (which == 1) {
for (int x = -1; x <= 1; ++x) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(x, y, 256 * id + data.radius, ThaumicHorizons.blockVoid);
setBlock(world, x, y, 256 * id + data.radius, ThaumicHorizons.blockVoid, 0);
}
}
data.portalA[0] = 0;
@@ -1645,7 +1653,7 @@ public class PocketPlaneData {
} else if (which == 2) {
for (int x = -1; x <= 1; ++x) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(x, y, 256 * id - data.radius, ThaumicHorizons.blockVoid);
setBlock(world, x, y, 256 * id - data.radius, ThaumicHorizons.blockVoid, 0);
}
}
data.portalB[0] = 0;
@@ -1654,7 +1662,7 @@ public class PocketPlaneData {
} else if (which == 3) {
for (int z = -1; z <= 1; ++z) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid);
setBlock(world, data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
}
}
data.portalC[0] = 0;
@@ -1663,7 +1671,7 @@ public class PocketPlaneData {
} else if (which == 4) {
for (int z = -1; z <= 1; ++z) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(-data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid);
setBlock(world, -data.radius, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
}
}
data.portalD[0] = 0;
@@ -1678,8 +1686,8 @@ public class PocketPlaneData {
if (which == 1) {
for (int x = -1; x <= 1; ++x) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(x, y, 256 * id + data.radius, ThaumicHorizons.blockPortal, 0, 3);
world.setBlock(x, y, 256 * id + data.radius + 1, ThaumicHorizons.blockVoid);
setBlock(world, x, y, 256 * id + data.radius, ThaumicHorizons.blockPortal, 0);
setBlock(world, x, y, 256 * id + data.radius + 1, ThaumicHorizons.blockVoid, 0);
}
}
data.portalA[0] = xCoord;
@@ -1688,8 +1696,8 @@ public class PocketPlaneData {
} else if (which == 2) {
for (int x = -1; x <= 1; ++x) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(x, y, 256 * id - data.radius, ThaumicHorizons.blockPortal, 2, 3);
world.setBlock(x, y, 256 * id - data.radius - 1, ThaumicHorizons.blockVoid);
setBlock(world, x, y, 256 * id - data.radius, ThaumicHorizons.blockPortal, 2);
setBlock(world, x, y, 256 * id - data.radius - 1, ThaumicHorizons.blockVoid, 0);
}
}
data.portalB[0] = xCoord;
@@ -1698,8 +1706,8 @@ public class PocketPlaneData {
} else if (which == 3) {
for (int z = -1; z <= 1; ++z) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 1, 3);
world.setBlock(data.radius + 1, y, 256 * id + z, ThaumicHorizons.blockVoid);
setBlock(world, data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 1);
setBlock(world, data.radius + 1, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
}
}
data.portalC[0] = xCoord;
@@ -1708,8 +1716,8 @@ public class PocketPlaneData {
} else if (which == 4) {
for (int z = -1; z <= 1; ++z) {
for (int y = 126; y <= 128; ++y) {
world.setBlock(-data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 3, 3);
world.setBlock(-data.radius - 1, y, 256 * id + z, ThaumicHorizons.blockVoid);
setBlock(world, -data.radius, y, 256 * id + z, ThaumicHorizons.blockPortal, 3);
setBlock(world, -data.radius - 1, y, 256 * id + z, ThaumicHorizons.blockVoid, 0);
}
}
data.portalD[0] = xCoord;
@@ -1,36 +0,0 @@
//
// Decompiled by Procyon v0.5.30
//
package com.kentington.thaumichorizons.common.lib;
import net.minecraft.world.World;
import thaumcraft.api.aspects.AspectList;
public class PocketPlaneThread implements Runnable {
PocketPlaneData data;
AspectList aspects;
World world;
int x;
int y;
int z;
int returnID;
public PocketPlaneThread(final PocketPlaneData data, final AspectList aspects, final World world, final int x,
final int y, final int z, final int returnID) {
this.data = data;
this.aspects = aspects;
this.world = world;
this.x = x;
this.y = y;
this.z = z;
this.returnID = returnID;
}
@Override
public void run() {
PocketPlaneData.generatePocketPlane(this.aspects, this.data, this.world, this.x, this.y, this.z, this.returnID);
}
}
@@ -33,7 +33,6 @@ import net.minecraftforge.common.DimensionManager;
import com.kentington.thaumichorizons.common.ThaumicHorizons;
import com.kentington.thaumichorizons.common.entities.EntityGolemTH;
import com.kentington.thaumichorizons.common.lib.PocketPlaneData;
import com.kentington.thaumichorizons.common.lib.PocketPlaneThread;
import com.kentington.thaumichorizons.common.lib.VortexTeleporter;
import cpw.mods.fml.common.FMLCommonHandler;
@@ -60,10 +59,8 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
boolean ateDevices;
public boolean collapsing;
public boolean createdDimension;
public boolean generating;
public boolean cheat;
public ArrayList<ItemStack> items;
Thread ppThread;
private boolean soundStarted = false;
// true once the first S35 description packet has been received on the client
public boolean clientSynced = false;
@@ -74,10 +71,8 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
this.ateDevices = false;
this.collapsing = false;
this.createdDimension = false;
this.generating = false;
this.cheat = false;
this.items = new ArrayList<ItemStack>();
this.ppThread = null;
this.items = new ArrayList<>();
}
public void updateEntity() {
@@ -95,114 +90,91 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
soundStarted = true;
}
if (this.generating) {
this.worldObj.createExplosion(
null,
this.xCoord + this.worldObj.rand.nextFloat(),
this.yCoord + this.worldObj.rand.nextFloat(),
this.zCoord + this.worldObj.rand.nextFloat(),
1.0f,
false);
if (this.ppThread == null) {
this.createDimension(null);
return;
}
if (!this.ppThread.isAlive()) {
this.generating = false;
this.createdDimension = true;
this.markDirty();
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
} else {
if (this.collapsing) {
++this.count;
if (this.count > 25) {
if (this.createdDimension) {
WorldServer wsd = DimensionManager.getWorld(ThaumicHorizons.dimensionPocketId);
if (wsd != null) {
wsd.setBlockToAir(0, 129, this.dimensionID * 256);
}
if (this.collapsing) {
++this.count;
if (this.count > 25) {
if (this.createdDimension) {
WorldServer wsd = DimensionManager.getWorld(ThaumicHorizons.dimensionPocketId);
if (wsd != null) {
wsd.setBlockToAir(0, 129, this.dimensionID * 256);
}
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
if (worldObj.isRemote)
Thaumcraft.proxy.burst(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 4.0f);
BlockAiry.explodify(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
return;
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
if (worldObj.isRemote)
Thaumcraft.proxy.burst(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 4.0f);
BlockAiry.explodify(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
if (this.count < 50) {
++this.count;
} else {
if (!this.ateDevices) {
if (!this.cheat && this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
for (int dx = -2; dx <= 2; ++dx) {
for (int dy = -2; dy <= 2; ++dy) {
for (int dz = -2; dz <= 2; ++dz) {
if (dx != 0 || dy != 0 || dz != 0) {
this.worldObj
.setBlockToAir(this.xCoord + dx, this.yCoord + dy, this.zCoord + dz);
if (worldObj.isRemote) Thaumcraft.proxy.burst(
this.worldObj,
this.xCoord + dx,
this.yCoord + dy,
this.zCoord + dz,
4.0f);
}
return;
}
if (this.count < 50) {
++this.count;
} else {
if (!this.ateDevices) {
if (!this.cheat && this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
for (int dx = -2; dx <= 2; ++dx) {
for (int dy = -2; dy <= 2; ++dy) {
for (int dz = -2; dz <= 2; ++dz) {
if (dx != 0 || dy != 0 || dz != 0) {
this.worldObj.setBlockToAir(this.xCoord + dx, this.yCoord + dy, this.zCoord + dz);
if (worldObj.isRemote) Thaumcraft.proxy.burst(
this.worldObj,
this.xCoord + dx,
this.yCoord + dy,
this.zCoord + dz,
4.0f);
}
}
}
}
this.ateDevices = true;
}
if (this.beams < 6 && !this.cheat
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
this.handleHungryNode();
} else if (!this.createdDimension && !this.generating) {
this.handlePocketPlaneStuff();
}
if (!this.cheat) {
this.count += Math.max(0, 6 - this.beams);
}
if (this.count > MAX_COUNT && !this.cheat
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
this.collapsing = true;
this.count = 0;
}
if (this.createdDimension) {
final List ents = this.worldObj.getEntitiesWithinAABB(
EntityPlayerMP.class,
AxisAlignedBB.getBoundingBox(
this.xCoord,
this.yCoord,
this.zCoord,
this.xCoord + 1,
this.yCoord + 1,
this.zCoord + 1));
if (ents.size() > 0) {
for (final Object e : ents) {
final EntityPlayerMP player = (EntityPlayerMP) e;
if (player.ridingEntity == null && player.riddenByEntity == null) {
final MinecraftServer mServer = FMLCommonHandler.instance()
.getMinecraftServerInstance();
if (player.timeUntilPortal > 0) {
player.timeUntilPortal = 10;
} else if (player.dimension != ThaumicHorizons.dimensionPocketId) {
player.timeUntilPortal = 200;
player.mcServer.getConfigurationManager().transferPlayerToDimension(
player,
ThaumicHorizons.dimensionPocketId,
new VortexTeleporter(
mServer.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
this.dimensionID));
} else {
player.timeUntilPortal = 200;
player.mcServer.getConfigurationManager().transferPlayerToDimension(
player,
this.returnID,
new VortexTeleporter(
mServer.worldServerForDimension(this.returnID),
this.dimensionID));
}
this.ateDevices = true;
}
if (this.beams < 6 && !this.cheat
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
this.handleHungryNode();
} else if (!this.createdDimension) {
this.handlePocketPlaneStuff();
}
if (!this.cheat) {
this.count += Math.max(0, 6 - this.beams);
}
if (this.count > MAX_COUNT && !this.cheat
&& this.worldObj.provider.dimensionId != ThaumicHorizons.dimensionPocketId) {
this.collapsing = true;
this.count = 0;
}
if (this.createdDimension) {
final List<EntityPlayerMP> ents = this.worldObj.getEntitiesWithinAABB(
EntityPlayerMP.class,
AxisAlignedBB.getBoundingBox(
this.xCoord,
this.yCoord,
this.zCoord,
this.xCoord + 1,
this.yCoord + 1,
this.zCoord + 1));
if (!ents.isEmpty()) {
for (final EntityPlayerMP player : ents) {
if (player.ridingEntity == null && player.riddenByEntity == null) {
final MinecraftServer mServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (player.timeUntilPortal > 0) {
player.timeUntilPortal = 10;
} else if (player.dimension != ThaumicHorizons.dimensionPocketId) {
player.timeUntilPortal = 200;
player.mcServer.getConfigurationManager().transferPlayerToDimension(
player,
ThaumicHorizons.dimensionPocketId,
new VortexTeleporter(
mServer.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
this.dimensionID));
} else {
player.timeUntilPortal = 200;
player.mcServer.getConfigurationManager().transferPlayerToDimension(
player,
this.returnID,
new VortexTeleporter(
mServer.worldServerForDimension(this.returnID),
this.dimensionID));
}
}
}
@@ -212,7 +184,7 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
}
void handlePocketPlaneStuff() {
final List ents = this.worldObj.getEntitiesWithinAABB(
final List<Entity> ents = this.worldObj.getEntitiesWithinAABB(
Entity.class,
AxisAlignedBB.getBoundingBox(
this.xCoord,
@@ -221,12 +193,18 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
this.xCoord + 1,
this.yCoord + 1,
this.zCoord + 1).expand(1.0, 1.0, 1.0));
if (ents != null && ents.size() > 0) {
for (final Object ent : ents) {
final Entity eo = (Entity) ent;
if (ents != null && !ents.isEmpty()) {
for (final Entity eo : ents) {
if (eo instanceof final EntityItem item) {
if (ThaumicHorizons.enablePocket && item.getEntityItem().getItem() == ConfigItems.itemEldritchObject
&& item.getEntityItem().getItemDamage() == 3) {
this.worldObj.createExplosion(
null,
this.xCoord + this.worldObj.rand.nextFloat(),
this.yCoord + this.worldObj.rand.nextFloat(),
this.zCoord + this.worldObj.rand.nextFloat(),
1.0f,
false);
this.createDimension(item);
item.setDead();
} else {
@@ -322,19 +300,19 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
if (DimensionManager.getWorld(ThaumicHorizons.dimensionPocketId) == null) {
DimensionManager.initDimension(ThaumicHorizons.dimensionPocketId);
}
this.generating = true;
if (!this.worldObj.isRemote) {
this.returnID = this.worldObj.provider.dimensionId;
(this.ppThread = new Thread(
new PocketPlaneThread(
data,
this.aspects,
(World) MinecraftServer.getServer()
.worldServerForDimension(ThaumicHorizons.dimensionPocketId),
this.xCoord,
this.yCoord,
this.zCoord,
this.returnID))).start();
World world = server.worldServerForDimension(ThaumicHorizons.dimensionPocketId);
PocketPlaneData.generatePocketPlane(
this.aspects,
data,
world,
this.xCoord,
this.yCoord,
this.zCoord,
this.returnID);
this.createdDimension = true;
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
this.markDirty();
}
@@ -451,7 +429,6 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
nbttagcompound.setBoolean("ateDevices", this.ateDevices);
nbttagcompound.setBoolean("collapsing", this.collapsing);
nbttagcompound.setBoolean("createdDimension", this.createdDimension);
nbttagcompound.setBoolean("isGenerating", this.generating);
nbttagcompound.setBoolean("cheat", this.cheat);
final NBTTagList tlist = new NBTTagList();
nbttagcompound.setTag("aspects", tlist);
@@ -482,7 +459,6 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
this.ateDevices = nbttagcompound.getBoolean("ateDevices");
this.collapsing = nbttagcompound.getBoolean("collapsing");
this.createdDimension = nbttagcompound.getBoolean("createdDimension");
this.generating = nbttagcompound.getBoolean("isGenerating");
this.cheat = nbttagcompound.getBoolean("cheat");
final AspectList al = new AspectList();
final NBTTagList tlist = nbttagcompound.getTagList("aspects", 10);
@@ -504,7 +480,7 @@ public class TileVortex extends TileThaumcraft implements IWandable, IAspectCont
@Override
public int onWandRightClick(final World world, final ItemStack wandstack, final EntityPlayer player, final int x,
final int y, final int z, final int side, final int md) {
if (!this.worldObj.isRemote && this.items.size() > 0) {
if (!this.worldObj.isRemote && !this.items.isEmpty()) {
final ItemStack item = this.items.get(0);
final EntityItem key = new EntityItem(this.worldObj);
key.setEntityItemStack(item);
@@ -87,8 +87,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###