Skip to content

Commit

Permalink
Merged branch feature/auto-crafting-indicator into master
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicBlom committed Nov 22, 2016
2 parents db52fed + 153cac4 commit 8a1c6a3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ minecraft {

repositories {
maven {
name = "chisel"
name = "tterrag"
url = "http://maven.tterrag.com/"
}
}

dependencies {
compile 'team.chisel:Chisel:MC1.9.4-' + config.chisel_version
compile 'team.chisel:Chisel:MC1.10.2-' + config.chisel_version
}

processResources
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# suppress inspection "UnusedProperty" for whole file
mod_version=1.4.0-rc
mod_version=1.4.0
mod_id=shearmadness
group_name=com.github.atomicblom.shearmadness

Expand All @@ -12,4 +12,4 @@ forge_version=12.18.2.2107
# simply re-run your setup task after changing the mappings to update your workspace.
mcp_mappings=snapshot_20161019

chisel_version=0.0.6.51
chisel_version=0.0.7.3
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class FlightBehaviour extends BehaviourBase {
private int framesTillNextTurn;
private double destinationMotionY;
private double currentMotionY;
private BlockPos sheepLocation = BlockPos.ORIGIN;

public FlightBehaviour(EntitySheep sheep, float floatHeight, boolean moveForward) {
super(sheep);
Expand All @@ -31,6 +32,11 @@ public void onBehaviourStarted(BlockPos currentPos) {
currentMotionY = 0.01;
}

@Override
public void onSheepMovedBlock(BlockPos previousLocation, BlockPos newLocation) {
sheepLocation = newLocation;
}

@Override
public void onBehaviourStopped(BlockPos previousPos) {
getEntity().fallDistance = 0;
Expand All @@ -39,7 +45,7 @@ public void onBehaviourStopped(BlockPos previousPos) {
@Override
public void updateTask() {
final EntitySheep entity = getEntity();
final BlockPos height = entity.worldObj.getHeight(entity.getPosition());
final BlockPos height = entity.worldObj.getHeight(sheepLocation);
final double actualHeight = entity.posY - height.getY();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ public static void dropItem(Entity nearEntity, ItemStack itemStack)
item.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
}

private static final PooledByteBufAllocator allocator = new PooledByteBufAllocator(false);

public static int getHash(ItemStack itemStack)
{
final ByteBuf buffer = new PooledByteBufAllocator(false).heapBuffer();
final ByteBuf buffer = allocator.heapBuffer();
final PacketBuffer packetBuffer = new PacketBuffer(buffer);
packetBuffer.writeItemStackToBuffer(itemStack);
return Arrays.hashCode(packetBuffer.array());
final int i = Arrays.hashCode(packetBuffer.array());
packetBuffer.release();
return i;
}
}

0 comments on commit 8a1c6a3

Please sign in to comment.