mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
708bbb5512 | ||
|
|
981305290a | ||
|
|
b6284e20dc | ||
|
|
2026024920 | ||
|
|
fe7b382b6a | ||
|
|
9430a0a6dd |
No files matched your search
+1
-1
@@ -39,6 +39,6 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
|
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:guide-api-228832:2287185") {transitive = false }
|
||||||
|
compileOnly("curse.maven:endlessids-665730:7585931") {transitive = false }
|
||||||
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.34:dev")
|
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.34:dev")
|
||||||
}
|
}
|
||||||
@@ -487,6 +487,7 @@ public class AlchemicalWizardry {
|
|||||||
public static boolean isChiselLoaded;
|
public static boolean isChiselLoaded;
|
||||||
public static boolean isFMPLoaded;
|
public static boolean isFMPLoaded;
|
||||||
public static boolean isPneumaticCraftLoaded;
|
public static boolean isPneumaticCraftLoaded;
|
||||||
|
public static boolean isEndlessIdsLoaded;
|
||||||
|
|
||||||
public static boolean wimpySettings;
|
public static boolean wimpySettings;
|
||||||
public static boolean respawnWithDebuff;
|
public static boolean respawnWithDebuff;
|
||||||
@@ -3248,6 +3249,7 @@ public class AlchemicalWizardry {
|
|||||||
public void postInit(FMLPostInitializationEvent event) {
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
proxy.registerPostSideObjects();
|
proxy.registerPostSideObjects();
|
||||||
isGregTechLoaded = Loader.isModLoaded("gregtech");
|
isGregTechLoaded = Loader.isModLoaded("gregtech");
|
||||||
|
isEndlessIdsLoaded = Loader.isModLoaded("endlessids");
|
||||||
// TODO Thaumcraft Integration
|
// TODO Thaumcraft Integration
|
||||||
if (Loader.isModLoaded("Thaumcraft")) {
|
if (Loader.isModLoaded("Thaumcraft")) {
|
||||||
isThaumcraftLoaded = true;
|
isThaumcraftLoaded = true;
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ public class IMCForNEI {
|
|||||||
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator", "nei.infopage.reagents.1");
|
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator", "nei.infopage.reagents.1");
|
||||||
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator|<AWWayofTime:terrae>", "nei.infopage.reagents.2");
|
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator|<AWWayofTime:terrae>", "nei.infopage.reagents.2");
|
||||||
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator,itemAttunedCrystal", "nei.infopage.reagents.3");
|
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator,itemAttunedCrystal", "nei.infopage.reagents.3");
|
||||||
|
sendInfoPage("AWWayofTime masterStone,blockAlchemicCalcinator,itemAttunedCrystal", "nei.infopage.reagents.3b");
|
||||||
sendInfoPage(
|
sendInfoPage(
|
||||||
"AWWayofTime masterStone,blockAlchemicCalcinator,itemTankSegmenter,itemDestinationClearer",
|
"AWWayofTime masterStone,blockAlchemicCalcinator,itemTankSegmenter,itemDestinationClearer",
|
||||||
"nei.infopage.reagents.4");
|
"nei.infopage.reagents.4");
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.api.ColourAndCoords;
|
import WayofTime.alchemicalWizardry.api.ColourAndCoords;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
@@ -283,13 +285,23 @@ public enum NewPacketHandler {
|
|||||||
protected void channelRead0(ChannelHandlerContext ctx, GaiaBiomeChangeMessage msg) {
|
protected void channelRead0(ChannelHandlerContext ctx, GaiaBiomeChangeMessage msg) {
|
||||||
Chunk chunk = AlchemicalWizardry.proxy.getClientWorld().getChunkFromChunkCoords(msg.chunkX, msg.chunkZ);
|
Chunk chunk = AlchemicalWizardry.proxy.getClientWorld().getChunkFromChunkCoords(msg.chunkX, msg.chunkZ);
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
byte[] biomeArray = chunk.getBiomeArray();
|
if (AlchemicalWizardry.isEndlessIdsLoaded) {
|
||||||
for (int i = 0; i < 16 * 16; ++i) {
|
short[] biomeArray = ((ChunkBiomeHook) chunk).getBiomeShortArray();
|
||||||
if (msg.mask.get(i)) {
|
for (int i = 0; i < 16 * 16; ++i) {
|
||||||
biomeArray[i] = msg.biome;
|
if (msg.mask.get(i)) {
|
||||||
|
biomeArray[i] = (short) 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -432,7 +444,7 @@ public enum NewPacketHandler {
|
|||||||
|
|
||||||
int chunkX;
|
int chunkX;
|
||||||
int chunkZ;
|
int chunkZ;
|
||||||
byte biome;
|
int biome;
|
||||||
BitSet mask;
|
BitSet mask;
|
||||||
// One bit per coordinate in a chunk, 16*16 bits = 32 bytes
|
// One bit per coordinate in a chunk, 16*16 bits = 32 bytes
|
||||||
public static final int maskByteCount = 32;
|
public static final int maskByteCount = 32;
|
||||||
@@ -629,7 +641,7 @@ public enum NewPacketHandler {
|
|||||||
GaiaBiomeChangeMessage m = (GaiaBiomeChangeMessage) msg;
|
GaiaBiomeChangeMessage m = (GaiaBiomeChangeMessage) msg;
|
||||||
target.writeInt(m.chunkX);
|
target.writeInt(m.chunkX);
|
||||||
target.writeInt(m.chunkZ);
|
target.writeInt(m.chunkZ);
|
||||||
target.writeByte(m.biome);
|
target.writeInt(m.biome);
|
||||||
byte[] arr = Arrays.copyOf(m.mask.toByteArray(), GaiaBiomeChangeMessage.maskByteCount);
|
byte[] arr = Arrays.copyOf(m.mask.toByteArray(), GaiaBiomeChangeMessage.maskByteCount);
|
||||||
target.writeBytes(arr);
|
target.writeBytes(arr);
|
||||||
}
|
}
|
||||||
@@ -812,7 +824,7 @@ public enum NewPacketHandler {
|
|||||||
GaiaBiomeChangeMessage m = (GaiaBiomeChangeMessage) msg;
|
GaiaBiomeChangeMessage m = (GaiaBiomeChangeMessage) msg;
|
||||||
m.chunkX = dat.readInt();
|
m.chunkX = dat.readInt();
|
||||||
m.chunkZ = dat.readInt();
|
m.chunkZ = dat.readInt();
|
||||||
m.biome = dat.readByte();
|
m.biome = dat.readInt();
|
||||||
|
|
||||||
byte[] buffer = new byte[GaiaBiomeChangeMessage.maskByteCount];
|
byte[] buffer = new byte[GaiaBiomeChangeMessage.maskByteCount];
|
||||||
dat.readBytes(buffer);
|
dat.readBytes(buffer);
|
||||||
@@ -989,7 +1001,7 @@ public enum NewPacketHandler {
|
|||||||
return INSTANCE.channels.get(Side.CLIENT).generatePacketFrom(msg);
|
return INSTANCE.channels.get(Side.CLIENT).generatePacketFrom(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Packet getGaiaBiomeChangePacket(int x, int z, byte biome, BitSet mask) {
|
public static Packet getGaiaBiomeChangePacket(int x, int z, int biome, BitSet mask) {
|
||||||
GaiaBiomeChangeMessage msg = new GaiaBiomeChangeMessage();
|
GaiaBiomeChangeMessage msg = new GaiaBiomeChangeMessage();
|
||||||
msg.index = 15;
|
msg.index = 15;
|
||||||
msg.chunkX = x;
|
msg.chunkX = x;
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
package WayofTime.alchemicalWizardry.common.block;
|
package WayofTime.alchemicalWizardry.common.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ChatComponentTranslation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.Int3;
|
||||||
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -41,6 +49,36 @@ public class BlockReagentConduit extends BlockContainer {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what,
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what,
|
||||||
float these, float are) {
|
float these, float are) {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
ItemStack held = player.getHeldItem();
|
||||||
|
if (held == null || !(held.getItem() instanceof IReagentManipulator)) {
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (tile instanceof TEReagentConduit relay) {
|
||||||
|
if (relay.reagentTargetList.isEmpty()) {
|
||||||
|
player.addChatComponentMessage(
|
||||||
|
new ChatComponentTranslation("message.reagentconduit.noconnections"));
|
||||||
|
} else {
|
||||||
|
player.addChatComponentMessage(
|
||||||
|
new ChatComponentTranslation("message.reagentconduit.connections"));
|
||||||
|
for (Map.Entry<Reagent, List<Int3>> entry : relay.reagentTargetList.entrySet()) {
|
||||||
|
Reagent reagent = entry.getKey();
|
||||||
|
List<Int3> offsets = entry.getValue();
|
||||||
|
if (offsets == null) continue;
|
||||||
|
for (Int3 offset : offsets) {
|
||||||
|
player.addChatComponentMessage(
|
||||||
|
new ChatComponentTranslation(
|
||||||
|
"message.reagentconduit.connection.entry",
|
||||||
|
reagent.name(),
|
||||||
|
x + offset.x(),
|
||||||
|
y + offset.y(),
|
||||||
|
z + offset.z()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-1
@@ -14,8 +14,13 @@ import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal
|
|||||||
public class BuildingSchematic {
|
public class BuildingSchematic {
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final int buildingType = DemonBuilding.BUILDING_HOUSE;
|
|
||||||
public final List<BlockSet> blockList = new ArrayList<>();
|
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() {
|
public BuildingSchematic() {
|
||||||
this("");
|
this("");
|
||||||
@@ -60,6 +65,13 @@ public class BuildingSchematic {
|
|||||||
return holder;
|
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) {
|
public List<Int3> getGriddedPositions(ForgeDirection dir) {
|
||||||
List<Int3> positionList = new ArrayList<>();
|
List<Int3> positionList = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ public class DemonBuilding {
|
|||||||
public DemonBuilding(BuildingSchematic schematic) {
|
public DemonBuilding(BuildingSchematic schematic) {
|
||||||
this.schematic = schematic;
|
this.schematic = schematic;
|
||||||
this.buildingType = schematic.buildingType;
|
this.buildingType = schematic.buildingType;
|
||||||
this.buildingTier = 0;
|
this.buildingTier = schematic.buildingTier;
|
||||||
this.area = this.createGSHForSchematic(schematic);
|
this.area = this.createGSHForSchematic(schematic);
|
||||||
this.doorGridSpace = new Int3(0, 0, 0);
|
this.doorGridSpace = schematic.getGridSpotOfDoor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -67,18 +67,10 @@ public class DemonBuilding {
|
|||||||
int z = doorSpace.z();
|
int z = doorSpace.z();
|
||||||
|
|
||||||
switch (sideOfRoad) {
|
switch (sideOfRoad) {
|
||||||
case SOUTH:
|
case SOUTH -> z++;
|
||||||
z++;
|
case EAST -> x++;
|
||||||
break;
|
case WEST -> x--;
|
||||||
case EAST:
|
default -> z--;
|
||||||
x++;
|
|
||||||
break;
|
|
||||||
case WEST:
|
|
||||||
x--;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
z--;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Int3(x, yLevel, z);
|
return new Int3(x, yLevel, z);
|
||||||
|
|||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
-18
@@ -945,23 +945,19 @@ public class TEDemonPortal extends TileEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void rightClickBlock(EntityPlayer player, int side) {
|
public void rightClickBlock(EntityPlayer player, int side) {
|
||||||
// if (worldObj.isRemote)
|
if (worldObj.isRemote || !player.capabilities.isCreativeMode) {
|
||||||
// {
|
return;
|
||||||
// return;
|
}
|
||||||
// }
|
|
||||||
//
|
this.initialize();
|
||||||
// this.initialize();
|
|
||||||
//
|
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP) {
|
||||||
// if (ForgeDirection.getOrientation(side) == ForgeDirection.UP)
|
this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0);
|
||||||
// {
|
} else if (ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) {
|
||||||
// this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0);
|
this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0);
|
||||||
// } else if (ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
|
} else {
|
||||||
// {
|
this.createRandomRoad();
|
||||||
// this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0);
|
}
|
||||||
// } else
|
|
||||||
// {
|
|
||||||
// this.createRandomRoad();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int createRandomBuilding(int type, int tier) {
|
public int createRandomBuilding(int type, int tier) {
|
||||||
@@ -1281,7 +1277,7 @@ public class TEDemonPortal extends TileEntity {
|
|||||||
|
|
||||||
public static void loadBuildingList() {
|
public static void loadBuildingList() {
|
||||||
String folder = "config/BloodMagic/schematics";
|
String folder = "config/BloodMagic/schematics";
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Int3.class, new Int3Adapter()).create();
|
||||||
|
|
||||||
File file = new File(folder);
|
File file = new File(folder);
|
||||||
File[] files = file.listFiles();
|
File[] files = file.listFiles();
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
int z = posZ + k;
|
int z = posZ + k;
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
int meta = world.getBlockMetadata(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
|
if (block == null || block.getBlockHardness(world, x, y, z) == -1
|
||||||
|| !world.canMineBlock(player, x, y, z)) {
|
|| !world.canMineBlock(player, x, y, z)) {
|
||||||
@@ -111,7 +110,8 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getStrVsBlock
|
// getStrVsBlock
|
||||||
if (func_150893_a(item, block) <= 1f && !(block instanceof BlockLeavesBase)) {
|
if ((func_150893_a(item, block) <= 1f && !(block instanceof BlockLeavesBase))
|
||||||
|
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
|
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
int z = posZ + k;
|
int z = posZ + k;
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
int meta = world.getBlockMetadata(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
|
if (block == null || block.getBlockHardness(world, x, y, z) == -1
|
||||||
|| !world.canMineBlock(player, x, y, z)) {
|
|| !world.canMineBlock(player, x, y, z)) {
|
||||||
@@ -119,7 +118,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getStrVsBlock
|
// getStrVsBlock
|
||||||
if (func_150893_a(item, block) <= 1f) {
|
if (func_150893_a(item, block) <= 1f || checkPermissions(world, x, y, z, block, meta, player)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
|
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getStrVsBlock
|
// getStrVsBlock
|
||||||
if (func_150893_a(item, block) <= 1f) {
|
if (func_150893_a(item, block) <= 1f
|
||||||
|
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
|
if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) {
|
||||||
|
|||||||
+132
-88
@@ -60,6 +60,9 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
|||||||
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean adv) {
|
public void addInformation(ItemStack item, EntityPlayer player, List<String> tooltip, boolean adv) {
|
||||||
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc1"));
|
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc1"));
|
||||||
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc2"));
|
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc2"));
|
||||||
|
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc3"));
|
||||||
|
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc4"));
|
||||||
|
tooltip.add(StatCollector.translateToLocal("tooltip.attunedcrystal.desc5"));
|
||||||
|
|
||||||
if (item.getTagCompound() == null) {
|
if (item.getTagCompound() == null) {
|
||||||
return;
|
return;
|
||||||
@@ -131,107 +134,141 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
|||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
// Sneak wipes the source first, then the reagent — regardless of where the cursor points.
|
||||||
|
if (player.isSneaking()) {
|
||||||
if (movingobjectposition == null) {
|
if (this.getHasSavedCoordinates(itemStack)) {
|
||||||
if (player.isSneaking()) {
|
|
||||||
this.setHasSavedCoordinates(itemStack, false);
|
this.setHasSavedCoordinates(itemStack, false);
|
||||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.clearing"));
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.clearing"));
|
||||||
|
} else if (this.getReagent(itemStack) != null) {
|
||||||
|
this.clearReagent(itemStack);
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.reagentcleared"));
|
||||||
|
}
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||||
|
if (movingobjectposition == null
|
||||||
|
|| movingobjectposition.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
int x = movingobjectposition.blockX;
|
||||||
|
int y = movingobjectposition.blockY;
|
||||||
|
int z = movingobjectposition.blockZ;
|
||||||
|
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if (!(tile instanceof IReagentHandler relay)) {
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.getHasSavedCoordinates(itemStack)) {
|
||||||
|
Int3 coords = this.getCoordinates(itemStack);
|
||||||
|
int dimension = this.getDimension(itemStack);
|
||||||
|
if (coords == null) {
|
||||||
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemStack;
|
// Re-clicking the saved source cycles its reagents, never tries to self-link.
|
||||||
} else {
|
if (dimension == world.provider.dimensionId && coords.x() == x && coords.y() == y && coords.z() == z) {
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
List<Reagent> reagentList = collectReagents(relay);
|
||||||
int x = movingobjectposition.blockX;
|
if (reagentList.size() <= 1) {
|
||||||
int y = movingobjectposition.blockY;
|
player.addChatComponentMessage(
|
||||||
int z = movingobjectposition.blockZ;
|
new ChatComponentTranslation("message.attunedcrystal.error.cannotlinktoself"));
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if (!(tile instanceof IReagentHandler relay)) {
|
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isSneaking()) {
|
Reagent pastReagent = this.getReagent(itemStack);
|
||||||
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
int reagentLocation = reagentList.indexOf(pastReagent);
|
||||||
if (infos != null) {
|
Reagent next = (reagentLocation == -1 || reagentLocation + 1 >= reagentList.size())
|
||||||
List<Reagent> reagentList = getReagents(infos);
|
? reagentList.getFirst()
|
||||||
|
: reagentList.get(reagentLocation + 1);
|
||||||
Reagent pastReagent = this.getReagent(itemStack);
|
this.setReagentWithNotification(itemStack, next, player);
|
||||||
|
return itemStack;
|
||||||
if (reagentList.isEmpty()) {
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
int reagentLocation;
|
|
||||||
|
|
||||||
reagentLocation = reagentList.indexOf(pastReagent);
|
|
||||||
|
|
||||||
if (reagentLocation == -1 || reagentLocation + 1 >= reagentList.size()) {
|
|
||||||
this.setReagentWithNotification(itemStack, reagentList.getFirst(), player);
|
|
||||||
} else {
|
|
||||||
this.setReagentWithNotification(itemStack, reagentList.get(reagentLocation + 1), player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.getHasSavedCoordinates(itemStack)) {
|
|
||||||
Int3 coords = this.getCoordinates(itemStack);
|
|
||||||
int dimension = this.getDimension(itemStack);
|
|
||||||
|
|
||||||
if (coords == null) {
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dimension != world.provider.dimensionId || Math.abs(coords.x() - x) > maxDistance
|
|
||||||
|| Math.abs(coords.y() - y) > maxDistance
|
|
||||||
|| Math.abs(coords.z() - z) > maxDistance) {
|
|
||||||
player.addChatComponentMessage(
|
|
||||||
new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity pastTile = world.getTileEntity(coords.x(), coords.y(), coords.z());
|
|
||||||
if (!(pastTile instanceof TEReagentConduit pastRelay)) {
|
|
||||||
player.addChatComponentMessage(
|
|
||||||
new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
Reagent reagent = this.getReagent(itemStack);
|
|
||||||
|
|
||||||
if (reagent == null) {
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isSneaking()) {
|
|
||||||
pastRelay.removeReagentDestinationViaActual(reagent, x, y, z);
|
|
||||||
} else {
|
|
||||||
if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) {
|
|
||||||
player.addChatComponentMessage(
|
|
||||||
new ChatComponentText(
|
|
||||||
StatCollector.translateToLocal("message.attunedcrystal.linked") + " "
|
|
||||||
+ reagent.name()));
|
|
||||||
} else {
|
|
||||||
player.addChatComponentMessage(
|
|
||||||
new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
world.markBlockForUpdate(coords.x(), coords.y(), coords.z());
|
|
||||||
} else {
|
|
||||||
int dimension = world.provider.dimensionId;
|
|
||||||
|
|
||||||
this.setDimension(itemStack, dimension);
|
|
||||||
this.setCoordinates(itemStack, new Int3(x, y, z));
|
|
||||||
|
|
||||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dimension != world.provider.dimensionId || Math.abs(coords.x() - x) > maxDistance
|
||||||
|
|| Math.abs(coords.y() - y) > maxDistance
|
||||||
|
|| Math.abs(coords.z() - z) > maxDistance) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileEntity pastTile = world.getTileEntity(coords.x(), coords.y(), coords.z());
|
||||||
|
if (!(pastTile instanceof TEReagentConduit pastRelay)) {
|
||||||
|
// Saved source is gone — clear it so the player can start over without a manual reset.
|
||||||
|
this.setHasSavedCoordinates(itemStack, false);
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
Reagent reagent = this.getReagent(itemStack);
|
||||||
|
if (reagent == null) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noreagent"));
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pastRelay.hasReagentDestination(reagent, x, y, z)) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.duplicate"));
|
||||||
|
} else if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z)) {
|
||||||
|
int used = pastRelay.getTotalConnections();
|
||||||
|
int max = pastRelay.maxConnextions;
|
||||||
|
player.addChatComponentMessage(
|
||||||
|
new ChatComponentTranslation("message.attunedcrystal.linked", reagent.name(), used, max));
|
||||||
|
// Successful link: clear the source so the next click starts a fresh link, but
|
||||||
|
// keep the reagent so the player can fan out to multiple destinations quickly.
|
||||||
|
this.setHasSavedCoordinates(itemStack, false);
|
||||||
|
} else {
|
||||||
|
player.addChatComponentMessage(
|
||||||
|
new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
||||||
|
}
|
||||||
|
world.markBlockForUpdate(coords.x(), coords.y(), coords.z());
|
||||||
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No saved source — this click saves one and (when useful) copies its reagent.
|
||||||
|
if (tile instanceof TEReagentConduit conduit && conduit.getTotalConnections() >= conduit.maxConnextions) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.sourcefull"));
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Reagent> reagentList = collectReagents(relay);
|
||||||
|
Reagent currentReagent = this.getReagent(itemStack);
|
||||||
|
if (reagentList.isEmpty() && currentReagent == null) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.nothingtocopy"));
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keep the crystal's existing reagent if the source has it (or if the source is empty);
|
||||||
|
// otherwise replace with the source's first tank.
|
||||||
|
if (!reagentList.isEmpty() && (currentReagent == null || !reagentList.contains(currentReagent))) {
|
||||||
|
this.setReagentWithNotification(itemStack, reagentList.getFirst(), player);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setDimension(itemStack, world.provider.dimensionId);
|
||||||
|
this.setCoordinates(itemStack, new Int3(x, y, z));
|
||||||
|
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking", x, y, z));
|
||||||
|
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<Reagent> collectReagents(IReagentHandler relay) {
|
||||||
|
List<Reagent> reagentList = new LinkedList<>();
|
||||||
|
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||||
|
if (infos == null) {
|
||||||
|
return reagentList;
|
||||||
|
}
|
||||||
|
for (ReagentContainerInfo info : infos) {
|
||||||
|
if (info == null) continue;
|
||||||
|
ReagentStack reagentStack = info.reagent;
|
||||||
|
if (reagentStack == null) continue;
|
||||||
|
Reagent reagent = reagentStack.reagent;
|
||||||
|
if (reagent != null && !reagentList.contains(reagent)) {
|
||||||
|
reagentList.add(reagent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return reagentList;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<Reagent> getReagents(ReagentContainerInfo[] infos) {
|
public static List<Reagent> getReagents(ReagentContainerInfo[] infos) {
|
||||||
List<Reagent> reagentList = new LinkedList<>();
|
List<Reagent> reagentList = new LinkedList<>();
|
||||||
for (ReagentContainerInfo info : infos) {
|
for (ReagentContainerInfo info : infos) {
|
||||||
@@ -248,6 +285,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator {
|
|||||||
return reagentList;
|
return reagentList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearReagent(ItemStack stack) {
|
||||||
|
if (!stack.hasTagCompound()) {
|
||||||
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
}
|
||||||
|
stack.getTagCompound().setString("reagent", "");
|
||||||
|
}
|
||||||
|
|
||||||
public void setCoordinates(ItemStack stack, Int3 coords) {
|
public void setCoordinates(ItemStack stack, Int3 coords) {
|
||||||
if (!stack.hasTagCompound()) {
|
if (!stack.hasTagCompound()) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
|||||||
+55
-11
@@ -1,6 +1,8 @@
|
|||||||
package WayofTime.alchemicalWizardry.common.items.energy;
|
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@@ -13,6 +15,8 @@ import net.minecraft.util.StatCollector;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.api.Int3;
|
||||||
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@@ -45,26 +49,66 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
|
|||||||
}
|
}
|
||||||
|
|
||||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||||
|
if (movingobjectposition == null
|
||||||
if (movingobjectposition == null) {
|
|| movingobjectposition.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
|
||||||
int x = movingobjectposition.blockX;
|
|
||||||
int y = movingobjectposition.blockY;
|
|
||||||
int z = movingobjectposition.blockZ;
|
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
int x = movingobjectposition.blockX;
|
||||||
|
int y = movingobjectposition.blockY;
|
||||||
|
int z = movingobjectposition.blockZ;
|
||||||
|
|
||||||
if (!(tile instanceof TEReagentConduit relay)) {
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
return itemStack;
|
if (!(tile instanceof TEReagentConduit relay)) {
|
||||||
}
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isSneaking()) {
|
||||||
|
int removed = clearIncomingConnections(world, x, y, z);
|
||||||
|
player.addChatComponentMessage(
|
||||||
|
new ChatComponentTranslation("message.destinationclearer.incoming.cleared", removed));
|
||||||
|
} else {
|
||||||
relay.reagentTargetList.clear();
|
relay.reagentTargetList.clear();
|
||||||
|
world.markBlockForUpdate(x, y, z);
|
||||||
player.addChatComponentMessage(new ChatComponentTranslation("message.destinationclearer.cleared"));
|
player.addChatComponentMessage(new ChatComponentTranslation("message.destinationclearer.cleared"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int clearIncomingConnections(World world, int x, int y, int z) {
|
||||||
|
int range = ItemAttunedCrystal.maxDistance;
|
||||||
|
int totalRemoved = 0;
|
||||||
|
for (int dx = -range; dx <= range; dx++) {
|
||||||
|
for (int dy = -range; dy <= range; dy++) {
|
||||||
|
for (int dz = -range; dz <= range; dz++) {
|
||||||
|
if (dx == 0 && dy == 0 && dz == 0) continue;
|
||||||
|
TileEntity neighbor = world.getTileEntity(x + dx, y + dy, z + dz);
|
||||||
|
if (!(neighbor instanceof TEReagentConduit src)) continue;
|
||||||
|
|
||||||
|
boolean changed = false;
|
||||||
|
Iterator<Map.Entry<Reagent, List<Int3>>> entries = src.reagentTargetList.entrySet().iterator();
|
||||||
|
while (entries.hasNext()) {
|
||||||
|
Map.Entry<Reagent, List<Int3>> entry = entries.next();
|
||||||
|
List<Int3> coords = entry.getValue();
|
||||||
|
if (coords == null) continue;
|
||||||
|
Iterator<Int3> it = coords.iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
Int3 off = it.next();
|
||||||
|
if (src.xCoord + off.x() == x && src.yCoord + off.y() == y && src.zCoord + off.z() == z) {
|
||||||
|
it.remove();
|
||||||
|
changed = true;
|
||||||
|
totalRemoved++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (coords.isEmpty()) entries.remove();
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
world.markBlockForUpdate(src.xCoord, src.yCoord, src.zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return totalRemoved;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+18
-6
@@ -19,6 +19,8 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
|
||||||
|
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||||
@@ -217,8 +219,10 @@ public class RitualEffectBiomeChanger extends RitualEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean eidLoaded = AlchemicalWizardry.isEndlessIdsLoaded;
|
||||||
for (Chunk chunk : chunkList) {
|
for (Chunk chunk : chunkList) {
|
||||||
byte[] byteArray = chunk.getBiomeArray();
|
byte[] byteArray = eidLoaded ? null : chunk.getBiomeArray();
|
||||||
|
short[] shortArray = eidLoaded ? ((ChunkBiomeHook) chunk).getBiomeShortArray() : null;
|
||||||
BitSet mask = new BitSet();
|
BitSet mask = new BitSet();
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
|
|
||||||
@@ -229,8 +233,13 @@ public class RitualEffectBiomeChanger extends RitualEffect {
|
|||||||
int offsetX = (chunk.xPosition << 4 | cX) - (x - range);
|
int offsetX = (chunk.xPosition << 4 | cX) - (x - range);
|
||||||
if (0 <= offsetX && offsetX < 2 * range + 1) {
|
if (0 <= offsetX && offsetX < 2 * range + 1) {
|
||||||
if (boolList[offsetX][offsetZ]) {
|
if (boolList[offsetX][offsetZ]) {
|
||||||
mask.set(cZ << 4 | cX, true);
|
int index = cZ << 4 | cX;
|
||||||
byteArray[cZ << 4 | cX] = (byte) biomeID;
|
mask.set(index, true);
|
||||||
|
if (eidLoaded) {
|
||||||
|
shortArray[index] = (short) biomeID;
|
||||||
|
} else {
|
||||||
|
byteArray[index] = (byte) biomeID;
|
||||||
|
}
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,10 +248,13 @@ public class RitualEffectBiomeChanger extends RitualEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
chunk.setBiomeArray(byteArray);
|
if (eidLoaded) {
|
||||||
|
((ChunkBiomeHook) chunk).setBiomeShortArray(shortArray);
|
||||||
|
} else {
|
||||||
|
chunk.setBiomeArray(byteArray);
|
||||||
|
}
|
||||||
NewPacketHandler.INSTANCE.sendToDimension(
|
NewPacketHandler.INSTANCE.sendToDimension(
|
||||||
NewPacketHandler
|
NewPacketHandler.getGaiaBiomeChangePacket(chunk.xPosition, chunk.zPosition, biomeID, mask),
|
||||||
.getGaiaBiomeChangePacket(chunk.xPosition, chunk.zPosition, (byte) biomeID, mask),
|
|
||||||
world.provider.dimensionId);
|
world.provider.dimensionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public class RitualEffectMagnetic extends RitualEffect {
|
|||||||
public int getRadiusForReagents(boolean hasTerrae, boolean hasOrbisTerrae) {
|
public int getRadiusForReagents(boolean hasTerrae, boolean hasOrbisTerrae) {
|
||||||
if (hasTerrae) {
|
if (hasTerrae) {
|
||||||
if (hasOrbisTerrae) {
|
if (hasOrbisTerrae) {
|
||||||
return 31;
|
return 34;
|
||||||
} else {
|
} else {
|
||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -62,9 +62,8 @@ public class DigAreaEffect implements IDigAreaEffect {
|
|||||||
|
|
||||||
float localHardness = block.getBlockHardness(world, x, y, z);
|
float localHardness = block.getBlockHardness(world, x, y, z);
|
||||||
|
|
||||||
if (localHardness - this.getHardnessDifference() > blockHardness
|
if (localHardness < 0 || localHardness - this.getHardnessDifference() > blockHardness
|
||||||
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)
|
|| BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) {
|
||||||
|| localHardness < 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
|
|||||||
consumptionMultiplier = 0;
|
consumptionMultiplier = 0;
|
||||||
efficiencyMultiplier = 0;
|
efficiencyMultiplier = 0;
|
||||||
capacityMultiplier = 1;
|
capacityMultiplier = 1;
|
||||||
|
orbCapacityMultiplier = 1;
|
||||||
isUpgraded = false;
|
isUpgraded = false;
|
||||||
upgradeLevel = 0;
|
upgradeLevel = 0;
|
||||||
isResultBlock = false;
|
isResultBlock = false;
|
||||||
|
|||||||
@@ -415,17 +415,31 @@ public class TEReagentConduit extends TileSegmentedReagentHandler {
|
|||||||
readClientNBT(packet.func_148857_g());
|
readClientNBT(packet.func_148857_g());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) {
|
public int getTotalConnections() {
|
||||||
int totalConnections = 0;
|
int total = 0;
|
||||||
|
for (List<Int3> list : this.reagentTargetList.values()) {
|
||||||
for (Entry<Reagent, List<Int3>> entry : this.reagentTargetList.entrySet()) {
|
if (list != null) {
|
||||||
if (entry.getValue() != null) {
|
total += list.size();
|
||||||
totalConnections += entry.getValue().size();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
if (totalConnections >= this.maxConnextions) {
|
public boolean hasReagentDestination(Reagent reagent, int x, int y, int z) {
|
||||||
// Send message that it cannot be done? Maybe add a Player instance
|
int xOffset = x - this.xCoord;
|
||||||
|
int yOffset = y - this.yCoord;
|
||||||
|
int zOffset = z - this.zCoord;
|
||||||
|
if (this.reagentTargetList.containsKey(reagent)) {
|
||||||
|
List<Int3> coords = this.reagentTargetList.get(reagent);
|
||||||
|
if (coords != null) {
|
||||||
|
return coords.contains(new Int3(xOffset, yOffset, zOffset));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean addReagentDestinationViaOffset(Reagent reagent, int xOffset, int yOffset, int zOffset) {
|
||||||
|
if (getTotalConnections() >= this.maxConnextions) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,6 +456,9 @@ public class TEReagentConduit extends TileSegmentedReagentHandler {
|
|||||||
newCoordList.add(newCoord);
|
newCoordList.add(newCoord);
|
||||||
this.reagentTargetList.put(reagent, newCoordList);
|
this.reagentTargetList.put(reagent, newCoordList);
|
||||||
} else {
|
} else {
|
||||||
|
if (coordList.contains(newCoord)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
coordList.add(newCoord);
|
coordList.add(newCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ import com.google.gson.GsonBuilder;
|
|||||||
|
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
import WayofTime.alchemicalWizardry.api.Int3;
|
||||||
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
|
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
|
||||||
|
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.Int3Adapter;
|
||||||
|
|
||||||
public class TESchematicSaver extends TileEntity {
|
public class TESchematicSaver extends TileEntity {
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ public class TESchematicSaver extends TileEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Int3.class, new Int3Adapter()).create();
|
||||||
String json = gson.toJson(schematic);
|
String json = gson.toJson(schematic);
|
||||||
try (Writer writer = new FileWriter("config/BloodMagic/schematics/" + new Random().nextInt() + ".json")) {
|
try (Writer writer = new FileWriter("config/BloodMagic/schematics/" + new Random().nextInt() + ".json")) {
|
||||||
writer.write(json);
|
writer.write(json);
|
||||||
|
|||||||
@@ -434,8 +434,11 @@ tooltip.alchemyflask.caution=CAUTION: Contents are throwable
|
|||||||
tooltip.alchemyflask.swigsleft=Swigs Left:
|
tooltip.alchemyflask.swigsleft=Swigs Left:
|
||||||
tooltip.armorinhibitor.desc1=Used to suppress a soul's
|
tooltip.armorinhibitor.desc1=Used to suppress a soul's
|
||||||
tooltip.armorinhibitor.desc2=unnatural abilities.
|
tooltip.armorinhibitor.desc2=unnatural abilities.
|
||||||
tooltip.attunedcrystal.desc1=A tool to tune alchemy
|
tooltip.attunedcrystal.desc1=1) Right-click a source relay to save it and copy its reagent.
|
||||||
tooltip.attunedcrystal.desc2=reagent transmission
|
tooltip.attunedcrystal.desc2=2) Right-click the same source again to cycle its reagent.
|
||||||
|
tooltip.attunedcrystal.desc3=3) Right-click a destination relay to link.
|
||||||
|
tooltip.attunedcrystal.desc4=Sneak+right-click to clear the saved source.
|
||||||
|
tooltip.attunedcrystal.desc5=Sneak+right-click again to clear the held reagent.
|
||||||
tooltip.blankspell.desc=Crystal of infinite possibilities.
|
tooltip.blankspell.desc=Crystal of infinite possibilities.
|
||||||
tooltip.bloodframe.desc=Stirs bees into a frenzy.
|
tooltip.bloodframe.desc=Stirs bees into a frenzy.
|
||||||
tooltip.bloodletterpack.desc=This pack really chafes...
|
tooltip.bloodletterpack.desc=This pack really chafes...
|
||||||
@@ -455,8 +458,8 @@ tooltip.crystalbelljar.empty=- Empty
|
|||||||
tooltip.demonictelepfocus.desc1=A stronger version of the focus,
|
tooltip.demonictelepfocus.desc1=A stronger version of the focus,
|
||||||
tooltip.demonictelepfocus.desc2=using a demonic shard
|
tooltip.demonictelepfocus.desc2=using a demonic shard
|
||||||
tooltip.demonplacer.desc=Used to spawn demons.
|
tooltip.demonplacer.desc=Used to spawn demons.
|
||||||
tooltip.destclearer.desc1=Used to clear the destination
|
tooltip.destclearer.desc1=Right-click a relay to clear its outgoing links.
|
||||||
tooltip.destclearer.desc2=list for an alchemy container
|
tooltip.destclearer.desc2=Sneak+right-click a relay to clear incoming links.
|
||||||
tooltip.diablokey.desc=Binds other items to the owner's network
|
tooltip.diablokey.desc=Binds other items to the owner's network
|
||||||
tooltip.divinationsigil.desc1=Peer into the soul to
|
tooltip.divinationsigil.desc1=Peer into the soul to
|
||||||
tooltip.divinationsigil.desc2=get the current essence
|
tooltip.divinationsigil.desc2=get the current essence
|
||||||
@@ -548,16 +551,26 @@ message.altar.progress=Altar's Progress: %,d LP / %,d LP
|
|||||||
message.altar.inputtank= Input Tank: %,d LP
|
message.altar.inputtank= Input Tank: %,d LP
|
||||||
message.altar.outputtank= Output Tank: %,d LP
|
message.altar.outputtank= Output Tank: %,d LP
|
||||||
message.altar.hunger=[BM] Your high regeneration rate has caused you to become hungry...
|
message.altar.hunger=[BM] Your high regeneration rate has caused you to become hungry...
|
||||||
message.attunedcrystal.clearing=Clearing saved container...
|
message.attunedcrystal.clearing=Cleared saved source.
|
||||||
message.attunedcrystal.error.cannotfind=Can no longer find linked container.
|
message.attunedcrystal.reagentcleared=Cleared held reagent.
|
||||||
|
message.attunedcrystal.error.cannotfind=Can no longer find saved source.
|
||||||
message.attunedcrystal.error.noconnections=Linked container has no connections remaining!
|
message.attunedcrystal.error.noconnections=Linked container has no connections remaining!
|
||||||
message.attunedcrystal.error.toofar=Linked container is either too far or is in a different dimension.
|
message.attunedcrystal.error.toofar=Saved source is either too far or is in a different dimension.
|
||||||
message.attunedcrystal.linked=Container is now linked. Transmitting:
|
message.attunedcrystal.error.noreagent=No reagent selected! Right-click a source relay to copy one.
|
||||||
message.attunedcrystal.linking=Linking to selected container.
|
message.attunedcrystal.error.duplicate=Already connected to that destination!
|
||||||
|
message.attunedcrystal.error.sourcefull=Source has no more open outgoing links.
|
||||||
|
message.attunedcrystal.error.cannotlinktoself=Cannot link a source to itself.
|
||||||
|
message.attunedcrystal.error.nothingtocopy=Source has no reagents to copy.
|
||||||
|
message.attunedcrystal.linked=Linked! Transmitting %s. (%s/%s connections used)
|
||||||
|
message.attunedcrystal.linking=Source relay saved at %s, %s, %s. Right-click a destination to link.
|
||||||
message.attunedcrystal.setto=Attuned Crystal now set to:
|
message.attunedcrystal.setto=Attuned Crystal now set to:
|
||||||
|
message.reagentconduit.noconnections=This relay has no routing connections.
|
||||||
|
message.reagentconduit.connections=Routing connections:
|
||||||
|
message.reagentconduit.connection.entry= %s -> (%s, %s, %s)
|
||||||
message.demon.shallfollow=I shall follow and protect you!
|
message.demon.shallfollow=I shall follow and protect you!
|
||||||
message.demon.willstay=I will stay here for now, Master.
|
message.demon.willstay=I will stay here for now, Master.
|
||||||
message.destinationclearer.cleared=Destination list now cleared.
|
message.destinationclearer.cleared=Destination list now cleared.
|
||||||
|
message.destinationclearer.incoming.cleared=Cleared %s incoming connection(s) from nearby relays.
|
||||||
message.divinationsigil.amount=Amount: %,d AR
|
message.divinationsigil.amount=Amount: %,d AR
|
||||||
message.divinationsigil.currentessence=Current Essence: %,d LP
|
message.divinationsigil.currentessence=Current Essence: %,d LP
|
||||||
message.divinationsigil.reagent=Reagent: %s
|
message.divinationsigil.reagent=Reagent: %s
|
||||||
@@ -737,6 +750,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.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.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.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 is required to transfer AR. Shift-right-click a block containing AR to attune the Router to that reagent. Then right-click the source block, followed by the destination block, to create a link. Shift-right-click in the air to remove the currently saved source.
|
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.4=An Alchemic Cleanser may be used to remove AR links by using it on the source block. 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.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.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.
|
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.
|
||||||
Reference in new issue
Block a user