Skip to content

Commit

Permalink
Update to 1.12.2, Update Mixins, Remove AccessTransformer, Close davi…
Browse files Browse the repository at this point in the history
…ncisvessels/#187 davincisvessels/#186
  • Loading branch information
darkevilmac committed Sep 28, 2017
1 parent 3e60350 commit 1c547d7
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 47 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.4-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:' + project.mixinGradleVersion
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}
Expand Down Expand Up @@ -66,19 +66,19 @@ mixin {
}

dependencies {
compile('org.spongepowered:mixin:0.6.9-SNAPSHOT') {
compile('org.spongepowered:mixin:' + project.mixinVersion) {
exclude module: 'launchwrapper'
exclude module: 'guava'
}

compile 'com.elytradev:concrete:0.2.2:all'
shadow 'com.elytradev:concrete:0.2.2:all'
compile 'com.elytradev:concrete:' + project.concreteVersion + ':all'
shadow 'com.elytradev:concrete:' + project.concreteVersion + ':all'
}

shadowJar {
exclude 'dummyThing'

relocate 'com.elytradev.concrete', "com.elytradev.movingworld.repackage.com.elytradev.concrete"
relocate 'com.elytradev.concrete', "com.elytradev.movingworld.repackage.com.elytradev.concrete"
dependencies {
include(dependency('org.spongepowered:mixin'))
include(dependency('com.elytradev:concrete'))
Expand Down
15 changes: 12 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
modGroup=com.elytradev
modVersion=5
modVersion=6
modBaseName=movingworld
forgeVersion=1.12-14.21.1.2406
mcpVersion=snapshot_20170623

#Forge Stuff
forgeVersion=1.12.2-14.23.0.2493
mcpVersion=snapshot_20170927

#Mixin Stuff
mixinVersion=0.7.4-SNAPSHOT
mixinGradleVersion=0.5-SNAPSHOT

#Eytra Stuff
concreteVersion=0.3.2-SNAPSHOT

# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.util.Map;

@IFMLLoadingPlugin.MCVersion(value = "1.12")
@IFMLLoadingPlugin.Name(value = "MovingWorldCore")
public class MovingWorldCoreMod implements IFMLLoadingPlugin {

public MovingWorldCoreMod() {
Expand Down Expand Up @@ -41,7 +41,7 @@ public void injectData(Map<String, Object> data) {

@Override
public String getAccessTransformerClass() {
return "com.elytradev.movingworld.common.asm.coremod.MovingWorldAccessTransformer";
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ public static boolean onEntityMove(Entity entity, MobileChunk mobileChunk, doubl
entity.setEntityBoundingBox(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ));

mixinEntity.resetPosToBB();
entity.isCollidedHorizontally = d6 != x || d8 != z;
entity.isCollidedVertically = d7 != y;
entity.onGround = entity.isCollidedVertically && d7 < 0.0D;
entity.isCollided = entity.isCollidedHorizontally || entity.isCollidedVertically;
entity.collidedHorizontally = d6 != x || d8 != z;
entity.collidedVertically = d7 != y;
entity.onGround = entity.collidedVertically && d7 < 0.0D;
entity.collided = entity.collidedVertically || entity.collidedVertically;
int i = MathHelper.floor(entityChunkPosX);
int j = MathHelper.floor(entityChunkPosY - 0.20000000298023224D);
int k = MathHelper.floor(entityChunkPosZ);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.elytradev.movingworld.common.chunk.mobilechunk;

import com.elytradev.concrete.reflect.accessor.Accessor;
import com.elytradev.concrete.reflect.accessor.Accessors;
import com.elytradev.movingworld.MovingWorldMod;
import com.elytradev.movingworld.api.IMovingTile;
import com.elytradev.movingworld.common.chunk.LocatedBlock;
Expand Down Expand Up @@ -33,6 +35,10 @@
import java.util.Map;

public abstract class MobileChunk implements IBlockAccess {

public static final Accessor<Block> TILE_BLOCK_TYPE = Accessors.findField(TileEntity.class, "blockType", "field_145854_h");
public static final Accessor<Integer> TILE_METADATA = Accessors.findField(TileEntity.class, "blockMetadata", "field_145847_g");

public static final int CHUNK_SIZE = 16;
public static final int CHUNK_MEMORY_USING = CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE * (4 + 2); //(16*16*16 shorts and ints)

Expand Down Expand Up @@ -256,8 +262,8 @@ public boolean addBlockWithState(BlockPos pos, IBlockState state) {
setTileEntity(pos, tileentity);
} else {
tileentity.updateContainingBlockInfo();
tileentity.blockType = block;
tileentity.blockMetadata = meta;
TILE_BLOCK_TYPE.set(tileentity, block);
TILE_METADATA.set(tileentity, meta);
}
}

Expand Down Expand Up @@ -413,7 +419,7 @@ public boolean setBlockState(BlockPos pos, IBlockState state) {

if (tileentity != null) {
tileentity.updateContainingBlockInfo();
tileentity.blockMetadata = block.getMetaFromState(state);
TILE_METADATA.set(tileentity, block.getMetaFromState(state));
}
}

Expand Down Expand Up @@ -509,7 +515,7 @@ private void setChunkBlockTileEntity(BlockPos pos, TileEntity newTile) {
chunkTileEntityMap.get(chunkPosition).invalidate(); //RIP
}

newTile.blockMetadata = block.getMetaFromState(blockState);
TILE_METADATA.set(newTile, block.getMetaFromState(blockState));
chunkTileEntityMap.put(chunkPosition, newTile);

if (newTile instanceof IMovingTile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ private boolean handleCollision(double cPosX, double cPosY, double cPosZ) {

if (block == Blocks.SNOW) {
world.setBlockToAir(new BlockPos(i1, l1, j1));
isCollidedHorizontally = false;
collidedHorizontally = false;
} else if (block == Blocks.WATERLILY) {
world.destroyBlock(new BlockPos(i1, l1, j1), true);
isCollidedHorizontally = false;
collidedHorizontally = false;
} else {
didCollide = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public MovingWorldHandlerClient(EntityMovingWorld movingWorld) {

@Override
public boolean processInitialInteract(EntityPlayer player, EnumHand hand) {
if (player.getDistanceSqToEntity(getMovingWorld()) >= 36D) {
if (player.getDistanceSq(getMovingWorld()) >= 36D) {
new FarInteractMessage(getMovingWorld(), hand).sendToServer();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.elytradev.movingworld.common.chunk.MovingWorldAssemblyInteractor;
import com.elytradev.movingworld.common.chunk.assembly.AssembleResult;
import com.elytradev.movingworld.common.chunk.assembly.ChunkAssembler;
import com.elytradev.movingworld.common.chunk.mobilechunk.MobileChunk;
import com.elytradev.movingworld.common.entity.EntityMovingWorld;
import com.elytradev.movingworld.common.entity.MovingWorldInfo;
import com.elytradev.movingworld.common.util.LocatedBlockList;
Expand All @@ -20,6 +21,8 @@

import java.util.UUID;

import static com.elytradev.movingworld.common.chunk.mobilechunk.MobileChunk.TILE_METADATA;

public abstract class TileMovingMarkingBlock extends TileEntity implements IMovingTile {

public LocatedBlockList removedFluidBlocks; // A list of fluid blocks that were destroyed last disassemble, used to fill back in when we reassemble.
Expand Down Expand Up @@ -175,7 +178,7 @@ public void readFromNBT(NBTTagCompound tag) {
if (tag.hasKey("owner")) {
getInfo().setOwner(UUID.fromString(tag.getString("owner")));
}
blockMetadata = tag.getInteger("meta");
TILE_METADATA.set(this, tag.getInteger("meta"));
if (tag.hasKey("ship") && world != null) {
int id = tag.getInteger("ship");
Entity entity = world.getEntityByID(id);
Expand Down Expand Up @@ -212,7 +215,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound tag) {
tag.setString("owner", getInfo().getOwner().toString());
}

tag.setInteger("meta", blockMetadata);
tag.setInteger("meta", TILE_METADATA.get(this));
tag.setString("name", getInfo().getName());
if (getParentMovingWorld() != null && !getParentMovingWorld().isDead) {
tag.setInteger("movingWorld", getParentMovingWorld().getEntityId());
Expand Down Expand Up @@ -241,7 +244,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound tag) {

public void writeNBTForSending(NBTTagCompound tag) {
super.writeToNBT(tag);
tag.setInteger("meta", blockMetadata);
tag.setInteger("meta", TILE_METADATA.get(this));
tag.setString("name", getInfo().getName());

if (getParentMovingWorld() != null && !getParentMovingWorld().isDead) {
Expand Down
23 changes: 0 additions & 23 deletions src/main/resources/MovingWorld_at.cfg

This file was deleted.

0 comments on commit 1c547d7

Please sign in to comment.