Skip to content

Commit

Permalink
moar cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Oct 1, 2018
1 parent 2440fec commit 528ca2c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 26 deletions.
9 changes: 4 additions & 5 deletions patches/net/minecraft/block/BlockRedstoneWire.java.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
--- a/net/minecraft/block/BlockRedstoneWire.java
+++ b/net/minecraft/block/BlockRedstoneWire.java
@@ -43,7 +43,8 @@
public static final IntegerProperty POWER = BlockStateProperties.POWER_0_15;
@@ -44,6 +44,8 @@
public static final Map<EnumFacing, EnumProperty<RedstoneSide>> FACING_PROPERTY_MAP = Maps.newEnumMap(ImmutableMap.of(EnumFacing.NORTH, NORTH, EnumFacing.EAST, EAST, EnumFacing.SOUTH, SOUTH, EnumFacing.WEST, WEST));
protected static final VoxelShape[] SHAPES = new VoxelShape[] {Block.makeCuboidShape(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D), Block.makeCuboidShape(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), Block.makeCuboidShape(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D), Block.makeCuboidShape(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), Block.makeCuboidShape(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), Block.makeCuboidShape(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 16.0D), Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 13.0D, 1.0D, 16.0D), Block.makeCuboidShape(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), Block.makeCuboidShape(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 16.0D), Block.makeCuboidShape(0.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), Block.makeCuboidShape(0.0D, 0.0D, 3.0D, 16.0D, 1.0D, 16.0D), Block.makeCuboidShape(3.0D, 0.0D, 0.0D, 16.0D, 1.0D, 13.0D), Block.makeCuboidShape(3.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D), Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 13.0D), Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D)};
- private boolean canProvidePower = true;
private boolean canProvidePower = true;
+ //CM changed to access for fast redstone
+ public boolean canProvidePower = true;
+ public void setCanProvidePower(boolean v) { canProvidePower = v; }
private final Set<BlockPos> blocksNeedingUpdate = Sets.<BlockPos>newHashSet();

public BlockRedstoneWire(Block.Properties builder)
@@ -190,7 +191,8 @@
@@ -190,7 +192,8 @@
return state;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--- a/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java
+++ b/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java
@@ -18,7 +18,8 @@
public class EntityAIFindEntityNearestPlayer extends EntityAIBase
@@ -19,6 +19,8 @@
{
private static final Logger LOGGER = LogManager.getLogger();
- private final EntityLiving entityLiving;
+ private final EntityLiving entityLiving; // CM so I can access
private final EntityLiving entityLiving;
+ // CM so I can access
+ protected EntityLiving getEntityLiving() { return entityLiving; }
private final Predicate<Entity> predicate;
private final EntityAINearestAttackableTarget.Sorter sorter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--- a/net/minecraft/entity/monster/EntityZombieVillager.java
+++ b/net/minecraft/entity/monster/EntityZombieVillager.java
@@ -35,7 +35,9 @@
{
@@ -36,6 +36,8 @@
private static final DataParameter<Boolean> CONVERTING = EntityDataManager.<Boolean>createKey(EntityZombieVillager.class, DataSerializers.BOOLEAN);
private static final DataParameter<Integer> PROFESSION = EntityDataManager.<Integer>createKey(EntityZombieVillager.class, DataSerializers.VARINT);
+ //[CM] public for entity info
private int conversionTime;
+ //[CM] public for entity info
+ public int getConversionTime() { return conversionTime; }
private UUID converstionStarter;

Expand Down
11 changes: 0 additions & 11 deletions patches/net/minecraft/util/WeightedRandom.java.patch

This file was deleted.

11 changes: 11 additions & 0 deletions patches/net/minecraft/world/biome/Biome.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/biome/Biome.java
+++ b/net/minecraft/world/biome/Biome.java
@@ -830,6 +830,8 @@
{
return EntityType.getId(this.entityType) + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.itemWeight;
}
+ //CM
+ public int getItemWeight() { return itemWeight; }
}

public static enum TempCategory
4 changes: 2 additions & 2 deletions src/main/java/carpet/helpers/RedstoneWireTurbo.java
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,14 @@ private IBlockState calculateCurrentChanges(final World worldIn, final UpdateNod
j = this.getMaxCurrentStrength(upd, j);
int l = 0;

wire.canProvidePower = false;
wire.setCanProvidePower(false);
// Unfortunately, World.isBlockIndirectlyGettingPowered is complicated,
// and I'm not ready to try to replicate even more functionality from
// elsewhere in Minecraft into this accelerator. So sadly, we must
// suffer the performance hit of this very expensive call. If there
// is consistency to what this call returns, we may be able to cache it.
final int k = worldIn.getRedstonePowerFromNeighbors(upd.self);
wire.canProvidePower = true;
wire.setCanProvidePower(true);

// The variable 'k' holds the maximum redstone power value of any adjacent blocks.
// If 'k' has the highest level of all neighbors, then the power level of this
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carpet/utils/SpawnReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public static List<ITextComponent> report(BlockPos pos, World worldIn)

String creature_name = entityliving.getEntityString();
String pack_size = String.format("%d", entityliving.getMaxSpawnedInChunk());//String.format("%d-%d", animal.minGroupCount, animal.maxGroupCount);
int weight = animal.itemWeight;
int weight = animal.getItemWeight();
if (canspawn)
{
String c = (fits_true && will_spawn>0)?"e":"gi";
Expand Down

0 comments on commit 528ca2c

Please sign in to comment.