-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now all the support from JEIDsI should be added......I missed a few alright? - Added HammerCore support - Updated and added to AdvancedRocketry - Fixed some more CreepingNether - And a style changes ........this isn't the end, I can feel it now.
- Loading branch information
1 parent
7ece54f
commit 1a67579
Showing
7 changed files
with
157 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...main/java/org/dimdev/jeid/mixin/modsupport/advancedrocketry/MixinPacketBiomeIDChange.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package org.dimdev.jeid.mixin.modsupport.advancedrocketry; | ||
|
||
import io.netty.buffer.ByteBuf; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.world.chunk.Chunk; | ||
import org.dimdev.jeid.INewChunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import zmaster587.advancedRocketry.AdvancedRocketry; | ||
import zmaster587.advancedRocketry.network.PacketBiomeIDChange; | ||
import zmaster587.libVulpes.util.HashedBlockPosition; | ||
|
||
@Pseudo | ||
@Mixin(PacketBiomeIDChange.class) | ||
public class MixinPacketBiomeIDChange { | ||
@Shadow | ||
Chunk chunk; | ||
@Shadow | ||
int worldId, xPos, zPos; | ||
@Shadow | ||
HashedBlockPosition pos; | ||
|
||
int[] intArray; | ||
|
||
@Inject(method = "<init>()V", at = @At("RETURN")) | ||
public void onConstructed(CallbackInfo ci) { | ||
intArray = new int[256]; | ||
} | ||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void write(ByteBuf out) { | ||
out.writeInt(worldId); | ||
out.writeInt(chunk.x); | ||
out.writeInt(chunk.z); | ||
out.writeInt(pos.x); | ||
out.writeShort(pos.y); | ||
out.writeInt(pos.z); | ||
|
||
for (int biomeId : ((INewChunk) chunk).getIntBiomeArray()) { | ||
out.writeInt(biomeId); | ||
} | ||
} | ||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void readClient(ByteBuf in) { | ||
worldId = in.readInt(); | ||
xPos = in.readInt(); | ||
zPos = in.readInt(); | ||
|
||
pos.x = in.readInt(); | ||
pos.y = in.readShort(); | ||
pos.z = in.readInt(); | ||
|
||
for (int i = 0; i < 256; i++) { | ||
int biomeId = in.readInt(); | ||
intArray[i] = biomeId; | ||
} | ||
} | ||
|
||
|
||
/** | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void executeClient(EntityPlayer thePlayer) { | ||
if (thePlayer.world.provider.getDimension() == worldId) { | ||
chunk = thePlayer.world.getChunk(xPos, zPos); | ||
if (chunk.isLoaded()) { | ||
((INewChunk) chunk).setIntBiomeArray(intArray); | ||
chunk.markDirty(); | ||
thePlayer.world.markBlockRangeForRenderUpdate(pos.getBlockPos(), pos.getBlockPos()); | ||
|
||
if (Minecraft.getMinecraft().gameSettings.particleSetting < 2) | ||
AdvancedRocketry.proxy.spawnParticle("smallLazer", thePlayer.world, pos.x, pos.y, pos.z, 0, 0, 0); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/org/dimdev/jeid/mixin/modsupport/hammercore/MixinWorldLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.dimdev.jeid.mixin.modsupport.hammercore; | ||
|
||
import com.zeitheron.hammercore.utils.WorldLocation; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.chunk.Chunk; | ||
import net.minecraftforge.fml.common.network.NetworkRegistry; | ||
import org.dimdev.jeid.INewChunk; | ||
import org.dimdev.jeid.network.BiomeChangeMessage; | ||
import org.dimdev.jeid.network.MessageManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Mixin(WorldLocation.class) | ||
public class MixinWorldLocation { | ||
@Shadow private World world; | ||
@Shadow private BlockPos pos; | ||
|
||
/** | ||
* | ||
* @author sk2048 | ||
*/ | ||
@Overwrite(remap = false) | ||
public void setBiome(Biome biome) { | ||
Chunk chunk = this.world.getChunk(this.pos); | ||
((INewChunk) chunk).getIntBiomeArray()[(this.pos.getZ() & 0xF) << 4 | this.pos.getX() & 0xF] = Biome.getIdForBiome(biome); | ||
chunk.markDirty(); | ||
if (!this.world.isRemote) { | ||
MessageManager.CHANNEL.sendToAllAround( | ||
new BiomeChangeMessage(this.pos.getX(), this.pos.getZ(), Biome.getIdForBiome(biome)), | ||
new NetworkRegistry.TargetPoint(this.world.provider.getDimension(), this.pos.getX(), 128.0D, this.pos.getZ(), 128.0D) | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters