mappings back to normal

This commit is contained in:
gnembon committed 2020-03-20 01:47:18 -03:00
1 parent eb6b15ffc3
commit 130ef80d30
23 files changed
+52 -49

No files matched your search

@@ -241,7 +241,7 @@ public class OptimizedExplosion
{
if (block.shouldDropItemsOnExplosion(e) && world instanceof ServerWorld)
{
BlockEntity blockEntity = block.method_26161() ? world.getBlockEntity(blockpos) : null; //hasBLockENtity
BlockEntity blockEntity = block.hasBlockEntity() ? world.getBlockEntity(blockpos) : null;
LootContext.Builder lootBuilder = new LootContext.Builder((ServerWorld) eAccess.getWorld())
.setRandom(eAccess.getWorld().random)
@@ -275,7 +275,7 @@ public class OptimizedExplosion
BlockPos down = blockpos1.down(1);
if (eAccess.getRandom().nextInt(3) == 0 &&
chunk.getBlockState(blockpos1).getMaterial() == Material.AIR &&
chunk.getBlockState(down).method_26216(world, down) //isFullOPaque
chunk.getBlockState(down).isOpaqueFullCube(world, down)
)
{
world.setBlockState(blockpos1, Blocks.FIRE.getDefaultState());
@@ -865,7 +865,7 @@ public class RedstoneWireTurbo
// position directly above the node being calculated is always
// at index 1.
UpdateNode center_up = upd.neighbor_nodes[1];
boolean center_up_is_cube = center_up.currentState.method_26212(worldIn, center_up.self); //isSimpleFUllBLock
boolean center_up_is_cube = center_up.currentState.isSolidBlock(worldIn, center_up.self); //isSimpleFUllBLock
for (int m=0; m<4; m++) {
// Get the neighbor array index of each of the four cardinal
@@ -879,7 +879,7 @@ public class RedstoneWireTurbo
// Also check the positions above and below the cardinal
// neighbors
boolean neighbor_is_cube = neighbor.currentState.method_26212(worldIn, neighbor.self); //isSimpleFUllBLock
boolean neighbor_is_cube = neighbor.currentState.isSolidBlock(worldIn, neighbor.self); //isSimpleFUllBLock
if (!neighbor_is_cube) {
UpdateNode neighbor_down = upd.neighbor_nodes[rs_neighbors_dn[m]];
l = getMaxCurrentStrength(neighbor_down, l);
@@ -1,14 +1,14 @@
package carpet.mixins;
import carpet.utils.RandomTools;
import net.minecraft.entity.FireworkEntity;
import net.minecraft.entity.projectile.FireworkRocketEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.Random;
@Mixin(FireworkEntity.class)
@Mixin(FireworkRocketEntity.class)
public class FireworkEntity_extremeMixin
{
@Redirect(method = "<init>(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;)V", expect = 2, at = @At(
@@ -1,7 +1,7 @@
package carpet.mixins;
import carpet.utils.RandomTools;
import net.minecraft.entity.projectile.FishingBobberEntity;
import net.minecraft.entity.FishingBobberEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -28,7 +28,7 @@ public abstract class GuardianEntityMixin extends HostileEntity
{
ElderGuardianEntity elderGuardian = new ElderGuardianEntity(EntityType.ELDER_GUARDIAN ,this.world);
elderGuardian.refreshPositionAndAngles(this.getX(), this.getY(), this.getZ(), this.yaw, this.pitch);
elderGuardian.initialize(this.world ,this.world.getLocalDifficulty(elderGuardian.getSenseCenterPos()), SpawnType.CONVERSION, (EntityData)null, (CompoundTag)null);
elderGuardian.initialize(this.world ,this.world.getLocalDifficulty(elderGuardian.getBlockPos()), SpawnType.CONVERSION, (EntityData)null, (CompoundTag)null);
elderGuardian.setAiDisabled(this.isAiDisabled());
if (this.hasCustomName())
@@ -50,10 +50,10 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
block != Blocks.SPAWNER;
}
@Redirect(method = "isMovable", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;method_26161()Z")) // hasBLockENtity
@Redirect(method = "isMovable", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;hasBlockEntity()Z")) // hasBLockENtity
private static boolean ifHasBlockEntity(Block block)
{
if (!block.method_26161()) // hasBlockENtity
if (!block.hasBlockEntity())
{
return false;
}
@@ -76,7 +76,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
for (int i = 0; i < list_1.size(); ++i)
{
BlockPos blockpos = list_1.get(i);
BlockEntity blockEntity = (list_2.get(i).getBlock().method_26161()) ? world_1.getBlockEntity(blockpos) : null; //hasBLockENtity
BlockEntity blockEntity = (list_2.get(i).getBlock().hasBlockEntity()) ? world_1.getBlockEntity(blockpos) : null;
list1_BlockEntities.get().add(blockEntity);
if (blockEntity != null)
{
@@ -4,6 +4,7 @@ import carpet.logging.LoggerRegistry;
import carpet.logging.logHelpers.TrajectoryLogHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileEntity;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.EntityHitResult;
@@ -14,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ProjectileEntity.class)
@Mixin(PersistentProjectileEntity.class)
public abstract class ProjectileEntityMixin extends Entity
{
private TrajectoryLogHelper logHelper;
@@ -1,6 +1,7 @@
package carpet.mixins;
import carpet.utils.RandomTools;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.projectile.ProjectileEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -8,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.Random;
@Mixin(ProjectileEntity.class)
@Mixin(PersistentProjectileEntity.class)
public class ProjectileEntity_extremeMixin
{
// calculates damage
@@ -1,14 +1,14 @@
package carpet.mixins;
import carpet.utils.RandomTools;
import net.minecraft.entity.projectile.Projectile;
import net.minecraft.entity.projectile.ProjectileEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.Random;
@Mixin(Projectile.class)
@Mixin(ProjectileEntity.class)
public class Projectile_extremeMixin
{
@Redirect(method = "setVelocity", expect = 3, at = @At(
@@ -103,9 +103,9 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
BlockState blockState_3 = world_1.getBlockState(blockPos_2);
int_3 = this.increasePower(int_3, blockState_3);
BlockPos blockPos_3 = blockPos_1.up();
if (blockState_3.method_26212(world_1, blockPos_2) && !world_1.getBlockState(blockPos_3).method_26212(world_1, blockPos_3)) {
if (blockState_3.isSolidBlock(world_1, blockPos_2) && !world_1.getBlockState(blockPos_3).isSolidBlock(world_1, blockPos_3)) {
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.up()));
} else if (!blockState_3.method_26212(world_1, blockPos_2)) { //isSimpleFUllBLock
} else if (!blockState_3.isSolidBlock(world_1, blockPos_2)) { //isSimpleFUllBLock
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.down()));
}
}
@@ -107,7 +107,7 @@ public class SpawnHelperMixin
world.dimension.getType(),
(MobEntity) entity_1,
entity_1.getType().getCategory(),
entity_1.getSenseCenterPos());
entity_1.getBlockPos());
}
if (!SpawnReporter.mock_spawns)
return world.spawnEntity(entity_1);
@@ -2,15 +2,15 @@ package carpet.mixins;
import carpet.patches.EntityPlayerMPFake;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.thrown.ThrownEnderpearlEntity;
import net.minecraft.entity.thrown.ThrownItemEntity;
import net.minecraft.entity.projectile.thrown.EnderPearlEntity;
import net.minecraft.entity.projectile.thrown.ThrownItemEntity;
import net.minecraft.network.ClientConnection;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ThrownEnderpearlEntity.class)
@Mixin(EnderPearlEntity.class)
public abstract class ThrownEnderpearlEntity_fakePlayersMixin extends ThrownItemEntity
{
public ThrownEnderpearlEntity_fakePlayersMixin(EntityType<? extends ThrownItemEntity> entityType_1, World world_1)
@@ -5,7 +5,7 @@ import carpet.logging.logHelpers.TrajectoryLogHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.projectile.ProjectileEntity;
import net.minecraft.entity.thrown.ThrownEntity;
import net.minecraft.entity.projectile.thrown.ThrownEntity;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -1,7 +1,7 @@
package carpet.mixins;
import carpet.utils.RandomTools;
import net.minecraft.entity.thrown.ThrownEntity;
import net.minecraft.entity.projectile.thrown.ThrownEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -140,7 +140,7 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity
{
List<PointOfInterest> list_1 = ((ServerWorld) getEntityWorld()).getPointOfInterestStorage().getInCircle(
type -> type == PointOfInterestType.HOME,
getSenseCenterPos(),
getBlockPos(),
48, PointOfInterestStorage.OccupationStatus.ANY).collect(Collectors.toList());
for (PointOfInterest poi : list_1)
{
@@ -55,6 +55,8 @@ public abstract class World_movableTEMixin implements WorldInterface
@Shadow public abstract void updateComparators(BlockPos pos, Block block);
@Shadow public abstract boolean setBlockState(BlockPos pos, BlockState state, int flags);
/**
* @author 2No2Name
*/
@@ -122,11 +124,10 @@ public abstract class World_movableTEMixin implements WorldInterface
if ((int_1 & 16) == 0)
{
int int_2 = int_1 & -2;
blockState_2.method_26198((net.minecraft.world.IWorld) this, blockPos_1, int_2); // method_11637
blockState_1.method_26183((net.minecraft.world.IWorld) this, blockPos_1, int_2); //updateNEtihbourStates
blockState_1.method_26198((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_2.prepare((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.updateNeighbors((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.prepare((net.minecraft.world.IWorld) this, blockPos_1, int_2);
}
this.onBlockChanged(blockPos_1, blockState_2, blockState_3);
}
return true;
@@ -567,7 +567,7 @@ public class CarpetExpression
});
this.expr.addLazyFunction("solid", -1, (c, t, lv) ->
genericStateTest(c, "solid", lv, (s, p, w) -> new NumericValue(s.method_26212(w, p)))); // isSimpleFullBlock
genericStateTest(c, "solid", lv, (s, p, w) -> new NumericValue(s.isSolidBlock(w, p)))); // isSimpleFullBlock
this.expr.addLazyFunction("air", -1, (c, t, lv) ->
booleanStateTest(c, "air", lv, (s, p) -> s.isAir()));
@@ -731,7 +731,7 @@ public class CarpetExpression
});
this.expr.addLazyFunction("suffocates", -1, (c, t, lv) ->
genericStateTest(c, "suffocates", lv, (s, p, w) -> new NumericValue(s.method_26228(w, p)))); // canSuffocate
genericStateTest(c, "suffocates", lv, (s, p, w) -> new NumericValue(s.shouldSuffocate(w, p)))); // canSuffocate
this.expr.addLazyFunction("power", -1, (c, t, lv) ->
genericStateTest(c, "power", lv, (s, p, w) -> new NumericValue(w.getReceivedRedstonePower(p))));
@@ -1002,7 +1002,7 @@ public class CarpetExpression
this.expr.addLazyFunction("blocks_movement", -1, (c, t, lv) ->
booleanStateTest(c, "blocks_movement", lv, (s, p) ->
!s.method_26171 (((CarpetContext) c).s.getWorld(), p, NavigationType.LAND))); // canPathfindThrough
!s.canPathfindThrough(((CarpetContext) c).s.getWorld(), p, NavigationType.LAND)));
this.expr.addLazyFunction("block_sound", -1, (c, t, lv) ->
stateStringQuery(c, "block_sound", lv, (s, p) ->
@@ -1646,7 +1646,7 @@ public class CarpetExpression
return LazyValue.NULL;
} else {
if (!hasTag && entity_1 instanceof MobEntity) {
((MobEntity)entity_1).initialize(serverWorld, serverWorld.getLocalDifficulty(entity_1.getSenseCenterPos()), SpawnType.COMMAND, null, null);
((MobEntity)entity_1).initialize(serverWorld, serverWorld.getLocalDifficulty(entity_1.getBlockPos()), SpawnType.COMMAND, null, null);
}
Value res = new EntityValue(entity_1);
return (_c, _t) -> res;
@@ -134,7 +134,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
Block block = blockState.getBlock();
if (block instanceof InventoryProvider) {
inventory = ((InventoryProvider)block).getInventory(blockState, world, blockPos);
} else if (block.method_26161()) { // hasBLockENtity
} else if (block.hasBlockEntity()) {
BlockEntity blockEntity = BlockValue.getBlockEntity(world, blockPos);
if (blockEntity instanceof Inventory) {
inventory = (Inventory)blockEntity;
@@ -177,7 +177,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
if (inv == null)
return null;
return new InventoryLocator(e, e.getSenseCenterPos(), inv, offset + 1);
return new InventoryLocator(e, e.getBlockPos(), inv, offset + 1);
}
else if (v1 instanceof BlockValue)
{
@@ -210,7 +210,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
}
PlayerEntity e = (PlayerEntity)((EntityValue) v2).getEntity();
inv = e.getEnderChestInventory();
return new InventoryLocator(e, e.getSenseCenterPos(), inv, offset + 2, true);
return new InventoryLocator(e, e.getBlockPos(), inv, offset + 2, true);
}
BlockPos pos = new BlockPos(
NumericValue.asNumber(v1).getDouble(),
+6 -6
View File
@@ -184,8 +184,8 @@ public class BlockInfo
lst.add(Messenger.s(String.format(" - Map colour: %s", mapColourName.get(state.getTopMaterialColor(world, pos)))));
lst.add(Messenger.s(String.format(" - Sound type: %s", soundName.get(block.getSoundGroup(state)))));
lst.add(Messenger.s(""));
//lst.add(Messenger.s(String.format(" - Full block: %s", block.isShapeFullCube()))); // isFullCube() )));
lst.add(Messenger.s(String.format(" - Normal cube: %s", state.method_26212(world, pos)))); //isNormalCube()))); isSimpleFullBlock
lst.add(Messenger.s(String.format(" - Full block: %s", state.isFullCube(world, pos)))); // isFullCube() )));
lst.add(Messenger.s(String.format(" - Normal cube: %s", state.isSolidBlock(world, pos)))); //isNormalCube()))); isSimpleFullBlock
lst.add(Messenger.s(String.format(" - Is liquid: %s", material.isLiquid())));
lst.add(Messenger.s(""));
lst.add(Messenger.s(String.format(" - Light in: %d, above: %d",
@@ -198,10 +198,10 @@ public class BlockInfo
//lst.add(Messenger.s(String.format(" - Emitted light: %d", state.getLightValue())));
//lst.add(Messenger.s(String.format(" - Picks neighbour light value: %s", state.useNeighborBrightness(world, pos))));
lst.add(Messenger.s(""));
lst.add(Messenger.s(String.format(" - Causes suffocation: %s", state.method_26228(world, pos)))); //canSuffocate
lst.add(Messenger.s(String.format(" - Blocks movement on land: %s", !state.method_26171(world,pos, NavigationType.LAND)))); // canPathfindThrough
lst.add(Messenger.s(String.format(" - Blocks movement in air: %s", !state.method_26171(world,pos, NavigationType.AIR)))); // canPathfindThrough
lst.add(Messenger.s(String.format(" - Blocks movement in liquids: %s", !state.method_26171(world,pos, NavigationType.WATER)))); // canPathfindThrough
lst.add(Messenger.s(String.format(" - Causes suffocation: %s", state.shouldSuffocate(world, pos)))); //canSuffocate
lst.add(Messenger.s(String.format(" - Blocks movement on land: %s", !state.canPathfindThrough(world,pos, NavigationType.LAND))));
lst.add(Messenger.s(String.format(" - Blocks movement in air: %s", !state.canPathfindThrough(world,pos, NavigationType.AIR))));
lst.add(Messenger.s(String.format(" - Blocks movement in liquids: %s", !state.canPathfindThrough(world,pos, NavigationType.WATER))));
lst.add(Messenger.s(String.format(" - Can burn: %s", material.isBurnable())));
lst.add(Messenger.s(String.format(" - Requires a tool: %s", !material.isReplaceable()))); //?maybe
lst.add(Messenger.s(String.format(" - Hardness: %.2f", state.getHardness(world, pos))));
@@ -110,7 +110,7 @@ public class PerimeterDiagnostics
BlockState iblockstate_down = worldserver.getBlockState(pos.down());
BlockState iblockstate_up = worldserver.getBlockState(pos.up());
if ( iblockstate.getMaterial() == Material.WATER && iblockstate_down.getMaterial() == Material.WATER && !iblockstate_up.method_26212(worldserver, pos)) // isSimpleFUllBLock
if ( iblockstate.getMaterial() == Material.WATER && iblockstate_down.getMaterial() == Material.WATER && !iblockstate_up.isSolidBlock(worldserver, pos)) // isSimpleFUllBLock
{
result.liquid++;
if (add_water && diagnostic.check_entity_spawn(pos))
@@ -124,7 +124,7 @@ public class PerimeterDiagnostics
}
else
{
if (iblockstate_down.method_26212(worldserver, pos)) // isSimpleFUllBLock
if (iblockstate_down.isSolidBlock(worldserver, pos)) // isSimpleFUllBLock
{
Block block = iblockstate_down.getBlock();
boolean flag = block != Blocks.BEDROCK && block != Blocks.BARRIER;
@@ -178,7 +178,7 @@ public class PerimeterDiagnostics
{
el.refreshPositionAndAngles((float)pos.getX() + 0.5F, (float)pos.getY(), (float)pos.getZ()+0.5F, 0.0F, 0.0F);
return el.canSpawn(worldServer) && el.canSpawn(worldServer, SpawnType.NATURAL) &&
SpawnRestriction.canSpawn(el.getType(),el.getEntityWorld(), SpawnType.NATURAL, el.getSenseCenterPos(), el.getEntityWorld().random) &&
SpawnRestriction.canSpawn(el.getType(),el.getEntityWorld(), SpawnType.NATURAL, el.getBlockPos(), el.getEntityWorld().random) &&
worldServer.doesNotCollide(el); // check collision rules once they stop fiddling with them after 1.14.1
}
return false;
@@ -259,7 +259,7 @@ public class SpawnReporter
if (!(entity instanceof MobEntity) || !((MobEntity)entity).isPersistent())
{
EntityType type = entity.getType();
BlockPos pos = entity.getSenseCenterPos();
BlockPos pos = entity.getBlockPos();
lst.add( Messenger.c(
"w - ",
Messenger.tp("wb",pos),
@@ -449,7 +449,7 @@ public class SpawnReporter
will_spawn += 1;
}
}
mob.initialize(worldIn, worldIn.getLocalDifficulty(mob.getSenseCenterPos()), SpawnType.NATURAL, null, null);
mob.initialize(worldIn, worldIn.getLocalDifficulty(mob.getBlockPos()), SpawnType.NATURAL, null, null);
// the code invokes onInitialSpawn after getCanSpawHere
fits = fits1 && worldIn.doesNotCollide(mob);
if (fits)
+1 -1
View File
@@ -96,7 +96,7 @@ public class WoolTool
public static DyeColor getWoolColorAtPosition(World worldIn, BlockPos pos)
{
BlockState state = worldIn.getBlockState(pos);
if (state.getMaterial() != Material.WOOL || !state.method_26212(worldIn, pos)) //isSimpleFullBlock
if (state.getMaterial() != Material.WOOL || !state.isSolidBlock(worldIn, pos)) //isSimpleFullBlock
return null;
return Material2Dye.get(state.getTopMaterialColor(worldIn, pos));
}