Compare commits

..
8 Commits
18 changed files with 67 additions and 128 deletions

No files matched your search

+1 -1
View File
@@ -39,6 +39,6 @@ dependencies {
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
compileOnly("curse.maven:endlessids-665730:7585931") {transitive = false }
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.34:dev")
}
@@ -487,7 +487,6 @@ public class AlchemicalWizardry {
public static boolean isChiselLoaded;
public static boolean isFMPLoaded;
public static boolean isPneumaticCraftLoaded;
public static boolean isEndlessIdsLoaded;
public static boolean wimpySettings;
public static boolean respawnWithDebuff;
@@ -3249,7 +3248,6 @@ public class AlchemicalWizardry {
public void postInit(FMLPostInitializationEvent event) {
proxy.registerPostSideObjects();
isGregTechLoaded = Loader.isModLoaded("gregtech");
isEndlessIdsLoaded = Loader.isModLoaded("endlessids");
// TODO Thaumcraft Integration
if (Loader.isModLoaded("Thaumcraft")) {
isThaumcraftLoaded = true;
@@ -17,8 +17,6 @@ import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.util.ForgeDirection;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.ColourAndCoords;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
@@ -285,23 +283,13 @@ public enum NewPacketHandler {
protected void channelRead0(ChannelHandlerContext ctx, GaiaBiomeChangeMessage msg) {
Chunk chunk = AlchemicalWizardry.proxy.getClientWorld().getChunkFromChunkCoords(msg.chunkX, msg.chunkZ);
if (chunk != null) {
if (AlchemicalWizardry.isEndlessIdsLoaded) {
short[] biomeArray = ((ChunkBiomeHook) chunk).getBiomeShortArray();
for (int i = 0; i < 16 * 16; ++i) {
if (msg.mask.get(i)) {
biomeArray[i] = (short) msg.biome;
}
byte[] biomeArray = chunk.getBiomeArray();
for (int i = 0; i < 16 * 16; ++i) {
if (msg.mask.get(i)) {
biomeArray[i] = msg.biome;
}
((ChunkBiomeHook) chunk).setBiomeShortArray(biomeArray);
} else {
byte[] biomeArray = chunk.getBiomeArray();
for (int i = 0; i < 16 * 16; ++i) {
if (msg.mask.get(i)) {
biomeArray[i] = (byte) msg.biome;
}
}
chunk.setBiomeArray(biomeArray);
}
chunk.setBiomeArray(biomeArray);
}
}
}
@@ -444,7 +432,7 @@ public enum NewPacketHandler {
int chunkX;
int chunkZ;
int biome;
byte biome;
BitSet mask;
// One bit per coordinate in a chunk, 16*16 bits = 32 bytes
public static final int maskByteCount = 32;
@@ -641,7 +629,7 @@ public enum NewPacketHandler {
GaiaBiomeChangeMessage m = (GaiaBiomeChangeMessage) msg;
target.writeInt(m.chunkX);
target.writeInt(m.chunkZ);
target.writeInt(m.biome);
target.writeByte(m.biome);
byte[] arr = Arrays.copyOf(m.mask.toByteArray(), GaiaBiomeChangeMessage.maskByteCount);
target.writeBytes(arr);
}
@@ -824,7 +812,7 @@ public enum NewPacketHandler {
GaiaBiomeChangeMessage m = (GaiaBiomeChangeMessage) msg;
m.chunkX = dat.readInt();
m.chunkZ = dat.readInt();
m.biome = dat.readInt();
m.biome = dat.readByte();
byte[] buffer = new byte[GaiaBiomeChangeMessage.maskByteCount];
dat.readBytes(buffer);
@@ -1001,7 +989,7 @@ public enum NewPacketHandler {
return INSTANCE.channels.get(Side.CLIENT).generatePacketFrom(msg);
}
public static Packet getGaiaBiomeChangePacket(int x, int z, int biome, BitSet mask) {
public static Packet getGaiaBiomeChangePacket(int x, int z, byte biome, BitSet mask) {
GaiaBiomeChangeMessage msg = new GaiaBiomeChangeMessage();
msg.index = 15;
msg.chunkX = x;
@@ -14,13 +14,8 @@ import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal
public class BuildingSchematic {
public final String name;
public final int buildingType = DemonBuilding.BUILDING_HOUSE;
public final List<BlockSet> blockList = new ArrayList<>();
// Set by GSON when reading structure schematics, do not remove
public int doorX = 0;
public int doorZ = 0;
public int doorY = 0;
public int buildingTier = 0;
public int buildingType = DemonBuilding.BUILDING_HOUSE;
public BuildingSchematic() {
this("");
@@ -65,13 +60,6 @@ public class BuildingSchematic {
return holder;
}
public Int3 getGridSpotOfDoor() {
int gridX = (int) ((doorX + 2 * Math.signum(doorX)) / 5);
int gridZ = (int) ((doorZ + 2 * Math.signum(doorZ)) / 5);
return new Int3(gridX, doorY, gridZ);
}
public List<Int3> getGriddedPositions(ForgeDirection dir) {
List<Int3> positionList = new ArrayList<>();
@@ -20,9 +20,9 @@ public class DemonBuilding {
public DemonBuilding(BuildingSchematic schematic) {
this.schematic = schematic;
this.buildingType = schematic.buildingType;
this.buildingTier = schematic.buildingTier;
this.buildingTier = 0;
this.area = this.createGSHForSchematic(schematic);
this.doorGridSpace = schematic.getGridSpotOfDoor();
this.doorGridSpace = new Int3(0, 0, 0);
}
public String getName() {
@@ -67,10 +67,18 @@ public class DemonBuilding {
int z = doorSpace.z();
switch (sideOfRoad) {
case SOUTH -> z++;
case EAST -> x++;
case WEST -> x--;
default -> z--;
case SOUTH:
z++;
break;
case EAST:
x++;
break;
case WEST:
x--;
break;
default:
z--;
break;
}
return new Int3(x, yLevel, z);
@@ -1,39 +0,0 @@
package WayofTime.alchemicalWizardry.common.demonVillage.tileEntity;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import WayofTime.alchemicalWizardry.api.Int3;
public class Int3Adapter extends TypeAdapter<Int3> {
@Override
public Int3 read(JsonReader reader) throws IOException {
int x = 0, y = 0, z = 0;
reader.beginObject();
while (reader.hasNext()) {
switch (reader.nextName()) {
case "xCoord" -> x = reader.nextInt();
case "yCoord" -> y = reader.nextInt();
case "zCoord" -> z = reader.nextInt();
default -> reader.skipValue();
}
}
reader.endObject();
return new Int3(x, y, z);
}
@Override
public void write(JsonWriter writer, Int3 int3) throws IOException {
writer.beginObject();
writer.name("xCoord").value(int3.x());
writer.name("yCoord").value(int3.y());
writer.name("zCoord").value(int3.z());
writer.endObject();
}
}
@@ -945,19 +945,23 @@ public class TEDemonPortal extends TileEntity {
}
public void rightClickBlock(EntityPlayer player, int side) {
if (worldObj.isRemote || !player.capabilities.isCreativeMode) {
return;
}
this.initialize();
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP) {
this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0);
} else if (ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) {
this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0);
} else {
this.createRandomRoad();
}
// if (worldObj.isRemote)
// {
// return;
// }
//
// this.initialize();
//
// if (ForgeDirection.getOrientation(side) == ForgeDirection.UP)
// {
// this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0);
// } else if (ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
// {
// this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0);
// } else
// {
// this.createRandomRoad();
// }
}
public int createRandomBuilding(int type, int tier) {
@@ -1277,7 +1281,7 @@ public class TEDemonPortal extends TileEntity {
public static void loadBuildingList() {
String folder = "config/BloodMagic/schematics";
Gson gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Int3.class, new Int3Adapter()).create();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
File file = new File(folder);
File[] files = file.listFiles();
@@ -82,6 +82,7 @@ public class EntityBoulderFist extends EntityDemon {
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(18, this.getHealth());
this.setCombatTask();
}
protected void playStepSound(int par1, int par2, int par3, int par4) {
@@ -82,6 +82,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(18, this.getHealth());
this.setCombatTask();
}
protected void playStepSound(int par1, int par2, int par3, int par4) {
@@ -84,6 +84,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(18, this.getHealth());
this.setCombatTask();
}
protected void playStepSound(int par1, int par2, int par3, int par4) {
@@ -103,6 +103,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
int z = posZ + k;
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if (BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) continue;
if (block == null || block.getBlockHardness(world, x, y, z) == -1
|| !world.canMineBlock(player, x, y, z)) {
@@ -110,8 +111,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
}
// getStrVsBlock
if ((func_150893_a(item, block) <= 1f && !(block instanceof BlockLeavesBase))
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) {
if (func_150893_a(item, block) <= 1f && !(block instanceof BlockLeavesBase)) {
continue;
}
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
@@ -111,6 +111,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
int z = posZ + k;
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if (checkPermissions(world, x, y, z, block, meta, player)) continue;
if (block == null || block.getBlockHardness(world, x, y, z) == -1
|| !world.canMineBlock(player, x, y, z)) {
@@ -118,7 +119,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
}
// getStrVsBlock
if (func_150893_a(item, block) <= 1f || checkPermissions(world, x, y, z, block, meta, player)) {
if (func_150893_a(item, block) <= 1f) {
continue;
}
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
@@ -114,8 +114,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
}
// getStrVsBlock
if (func_150893_a(item, block) <= 1f
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) {
if (func_150893_a(item, block) <= 1f) {
continue;
}
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
@@ -40,6 +40,7 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean adv) {
tooltip.add(StatCollector.translateToLocal("tooltip.destclearer.desc1"));
tooltip.add(StatCollector.translateToLocal("tooltip.destclearer.desc2"));
tooltip.add(StatCollector.translateToLocal("tooltip.destclearer.desc3"));
}
@Override
@@ -19,8 +19,6 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
@@ -219,10 +217,8 @@ public class RitualEffectBiomeChanger extends RitualEffect {
}
}
boolean eidLoaded = AlchemicalWizardry.isEndlessIdsLoaded;
for (Chunk chunk : chunkList) {
byte[] byteArray = eidLoaded ? null : chunk.getBiomeArray();
short[] shortArray = eidLoaded ? ((ChunkBiomeHook) chunk).getBiomeShortArray() : null;
byte[] byteArray = chunk.getBiomeArray();
BitSet mask = new BitSet();
boolean changed = false;
@@ -233,13 +229,8 @@ public class RitualEffectBiomeChanger extends RitualEffect {
int offsetX = (chunk.xPosition << 4 | cX) - (x - range);
if (0 <= offsetX && offsetX < 2 * range + 1) {
if (boolList[offsetX][offsetZ]) {
int index = cZ << 4 | cX;
mask.set(index, true);
if (eidLoaded) {
shortArray[index] = (short) biomeID;
} else {
byteArray[index] = (byte) biomeID;
}
mask.set(cZ << 4 | cX, true);
byteArray[cZ << 4 | cX] = (byte) biomeID;
changed = true;
}
}
@@ -248,13 +239,10 @@ public class RitualEffectBiomeChanger extends RitualEffect {
}
if (changed) {
if (eidLoaded) {
((ChunkBiomeHook) chunk).setBiomeShortArray(shortArray);
} else {
chunk.setBiomeArray(byteArray);
}
chunk.setBiomeArray(byteArray);
NewPacketHandler.INSTANCE.sendToDimension(
NewPacketHandler.getGaiaBiomeChangePacket(chunk.xPosition, chunk.zPosition, biomeID, mask),
NewPacketHandler
.getGaiaBiomeChangePacket(chunk.xPosition, chunk.zPosition, (byte) biomeID, mask),
world.provider.dimensionId);
}
}
@@ -62,8 +62,9 @@ public class DigAreaEffect implements IDigAreaEffect {
float localHardness = block.getBlockHardness(world, x, y, z);
if (localHardness < 0 || localHardness - this.getHardnessDifference() > blockHardness
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) {
if (localHardness - this.getHardnessDifference() > blockHardness
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)
|| localHardness < 0) {
return;
}
@@ -14,9 +14,7 @@ import com.google.gson.GsonBuilder;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.Int3Adapter;
public class TESchematicSaver extends TileEntity {
@@ -44,7 +42,7 @@ public class TESchematicSaver extends TileEntity {
}
}
}
Gson gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Int3.class, new Int3Adapter()).create();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(schematic);
try (Writer writer = new FileWriter("config/BloodMagic/schematics/" + new Random().nextInt() + ".json")) {
writer.write(json);
@@ -459,7 +459,8 @@ tooltip.demonictelepfocus.desc1=A stronger version of the focus,
tooltip.demonictelepfocus.desc2=using a demonic shard
tooltip.demonplacer.desc=Used to spawn demons.
tooltip.destclearer.desc1=Right-click a relay to clear its outgoing links.
tooltip.destclearer.desc2=Sneak+right-click a relay to clear incoming links.
tooltip.destclearer.desc2=Sneak+right-click a relay to clear links
tooltip.destclearer.desc3=pointing AT it from nearby relays.
tooltip.diablokey.desc=Binds other items to the owner's network
tooltip.divinationsigil.desc1=Peer into the soul to
tooltip.divinationsigil.desc2=get the current essence
@@ -750,7 +751,7 @@ nei.infopage.rituals.2=To build a ritual, place a Master Ritual Stone surrounded
nei.infopage.rituals.3=Once the ritual is assembled, right-click the Master Ritual Stone with a bound Activation Crystal. If everything is in place and your Soul Network contains sufficient LP, the ritual will commence! Each ritual has a unique effect. Experimentation is encouraged to discover the full potential of the Master Ritual Stone.
nei.infopage.reagents.1=Some rituals can be modified by providing reagents to the Master Ritual Stone. However, raw reagents are too impure to be used directly. They must first be refined in an Alchemic Calcinator into AR (Alchemy Reagent), a pure essence usable by the ritual.
nei.infopage.reagents.2=To use an Alchemic Calcinator, right-click it with a bound Blood Orb, and then right-click it with the reagent item. Reagents may also be inserted via hoppers or pipes. The reagent will be consumed and converted into AR, which the Calcinator will store internally.
nei.infopage.reagents.3=An Alchemic Router transfers AR. Right-click a block that can hold AR to save it as the source. The first reagent in the source is copied automatically. Right-click the source again to cycle through its other reagents. Right-click a different block to link it as a destination.
nei.infopage.reagents.3b=After making a link, the source is cleared, but the reagent stays, so you can quickly make multiple links for the same reagent. Sneak+right-click anywhere before linking to clear the saved source. Sneak+right-click again to clear the saved reagent. Right-clicking a relay with an empty hand sends its current outgoing routing connections in chat.
nei.infopage.reagents.4=An Alchemic Cleanser clears AR routing connections — right-click a relay to wipe its outgoing links, or sneak+right-click to wipe incoming links. An Alchemic Segmenter may be used to limit how many internal AR tanks a single reagent may occupy. Attune it by shift+right-clicking a block with a stored reagent, then right-click a block to cycle how many tanks that reagent can fill.
nei.infopage.reagents.3=An Alchemic Router (Attuned Crystal) transfers AR. Right-click a block holding AR to save it as the source — the Router copies that source's AR automatically. Right-click the saved source again to cycle through its remaining AR types. Right-click a different block to link it as a destination; the source clears but the AR stays, so you can fan out to many destinations quickly.
nei.infopage.reagents.3b=Sneak+right-click anywhere to clear the saved source; sneak+right-click again to clear the held AR. Right-clicking a relay with an empty hand prints its current outgoing routing connections to chat.
nei.infopage.reagents.4=An Alchemic Cleanser clears AR routing connections — right-click a relay to wipe its outgoing links, or sneak+right-click to wipe nearby relays' links pointing AT it. An Alchemic Segmenter may be used to limit how many internal AR tanks a single reagent may occupy; it is attuned in the same way as the Router.
nei.infopage.reagents.5=The range of AR links is limited to a few blocks. To extend the transfer distance, use Alchemic Relays. Crystal Belljars may be placed to store AR, and they will retain their contents when broken.