1.14.3 pre 1

This commit is contained in:
gnembon committed 2019-06-03 22:37:12 -03:00
1 parent b5454a8285
commit 5faa8754fb
12 files changed
+19 -39

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ public class CarpetSettings
viewDistance = 64; viewDistance = 64;
} }
if (viewDistance != CarpetServer.minecraft_server.getPlayerManager().getViewDistance()) if (viewDistance != CarpetServer.minecraft_server.getPlayerManager().getViewDistance())
CarpetServer.minecraft_server.getPlayerManager().setViewDistance(viewDistance, viewDistance); CarpetServer.minecraft_server.getPlayerManager().setViewDistance(viewDistance);
} }
else else
{ {
@@ -56,7 +56,7 @@ public class BlockRotator
if (true) throw new UnsupportedOperationException("Alternative Block Placement / client controlled / is not implemnted"); if (true) throw new UnsupportedOperationException("Alternative Block Placement / client controlled / is not implemnted");
Direction facing; Direction facing;
Vec3d vec3d = context.getPos(); Vec3d vec3d = context.getHitPos();
float hitX = (float) vec3d.x; float hitX = (float) vec3d.x;
if (hitX<2) // vanilla if (hitX<2) // vanilla
@@ -53,7 +53,7 @@ public class HopperCounter
startMillis = System.currentTimeMillis(); startMillis = System.currentTimeMillis();
} }
Item item = stack.getItem(); Item item = stack.getItem();
counter.put(item, counter.getLong(item) + stack.getAmount()); counter.put(item, counter.getLong(item) + stack.getCount());
// pubSubProvider.publish(); // pubSubProvider.publish();
} }
@@ -38,7 +38,7 @@ public class ContainerMixin
if(int_1 == 0 && int_2 == 1) if(int_1 == 0 && int_2 == 1)
{ {
ItemStack itemStackDropAll = dropAllCrafting(playerEntity_1, int_1, slotList); ItemStack itemStackDropAll = dropAllCrafting(playerEntity_1, int_1, slotList);
while (!itemStackDropAll.isEmpty() && ItemStack.areEqual(slot_4.getStack(), itemStackDropAll)) while (!itemStackDropAll.isEmpty() && ItemStack.areItemsEqual(slot_4.getStack(), itemStackDropAll))
{ {
itemStack_1 = itemStackDropAll.copy(); itemStack_1 = itemStackDropAll.copy();
itemStackDropAll = dropAllCrafting(playerEntity_1, int_1, slotList); itemStackDropAll = dropAllCrafting(playerEntity_1, int_1, slotList);
@@ -61,10 +61,10 @@ public class ContainerMixin
if (index == 0) if (index == 0)
{ {
playerIn.dropItem(itemstack, true); playerIn.dropItem(itemstack, true);
itemstack1.setAmount(0); itemstack1.setCount(0);
slot.onStackChanged(itemstack1, itemstack); slot.onStackChanged(itemstack1, itemstack);
} }
if (itemstack.getAmount() == itemstack1.getAmount()) if (itemstack.getCount() == itemstack1.getCount())
{ {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
@@ -55,14 +55,14 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
method = "method_20397", method = "method_20397",
at = @At( at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/item/ItemStack;getMaxAmount()I" target = "Lnet/minecraft/item/ItemStack;getMaxCount()I"
) )
) )
private int getItemStackMaxAmount(ItemStack stack) { private int getItemStackMaxAmount(ItemStack stack) {
if (CarpetSettings.b_stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock) if (CarpetSettings.b_stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
return SHULKERBOX_MAX_STACK_AMOUNT; return SHULKERBOX_MAX_STACK_AMOUNT;
return stack.getMaxAmount(); return stack.getMaxCount();
} }
@Inject( @Inject(
@@ -82,17 +82,17 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
if (selfStack.getItem() == otherStack.getItem() if (selfStack.getItem() == otherStack.getItem()
&& !InventoryHelper.shulkerBoxHasItems(selfStack) && !InventoryHelper.shulkerBoxHasItems(selfStack)
&& selfStack.hasTag() == otherStack.hasTag() && selfStack.hasTag() == otherStack.hasTag()
&& selfStack.getAmount() + otherStack.getAmount() <= SHULKERBOX_MAX_STACK_AMOUNT) && selfStack.getCount() + otherStack.getCount() <= SHULKERBOX_MAX_STACK_AMOUNT)
{ {
int amount = Math.min(otherStack.getAmount(), SHULKERBOX_MAX_STACK_AMOUNT - selfStack.getAmount()); int amount = Math.min(otherStack.getCount(), SHULKERBOX_MAX_STACK_AMOUNT - selfStack.getCount());
selfStack.addAmount(amount); selfStack.increment(amount);
self.setStack(selfStack); self.setStack(selfStack);
this.pickupDelay = Math.max(((IItemEntity)other).getPickupDelay(), this.pickupDelay); this.pickupDelay = Math.max(((IItemEntity)other).getPickupDelay(), this.pickupDelay);
this.age = Math.min(((IItemEntity)other).getAge(), this.age); this.age = Math.min(((IItemEntity)other).getAge(), this.age);
otherStack.subtractAmount(amount); otherStack.decrement(amount);
if (otherStack.isEmpty()) if (otherStack.isEmpty())
{ {
other.remove(); other.remove();
@@ -1,6 +1,5 @@
package carpet.mixins; package carpet.mixins;
import carpet.fakes.WorldInterface;
import carpet.utils.SpawnReporter; import carpet.utils.SpawnReporter;
import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.entity.EntityCategory; import net.minecraft.entity.EntityCategory;
@@ -1,18 +0,0 @@
package carpet.mixins;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnRestriction;
import net.minecraft.world.Heightmap;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(SpawnRestriction.class)
public abstract class SpawnRestrictionMixin
{
@Shadow
private static void register(EntityType<?> a, SpawnRestriction.Location b, Heightmap.Type c) { }
static {
register(EntityType.SHULKER, SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES);
}
}
@@ -249,7 +249,7 @@ public class CarpetEventServer
((c, t) -> new EntityValue(player)), ((c, t) -> new EntityValue(player)),
((c, t) -> ListValue.of( ((c, t) -> ListValue.of(
new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()), new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()),
new NumericValue(itemstack.getAmount()), new NumericValue(itemstack.getCount()),
new StringValue(itemstack.toTag(new CompoundTag()).toString()) new StringValue(itemstack.toTag(new CompoundTag()).toString())
)), )),
((c, t) -> new StringValue(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand")) ((c, t) -> new StringValue(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand"))
@@ -278,7 +278,7 @@ public class CarpetEventServer
((c, t) -> new EntityValue(player)), ((c, t) -> new EntityValue(player)),
((c, t) -> ListValue.of( ((c, t) -> ListValue.of(
new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()), new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()),
new NumericValue(itemstack.getAmount()), new NumericValue(itemstack.getCount()),
new StringValue(itemstack.toTag(new CompoundTag()).toString()) new StringValue(itemstack.toTag(new CompoundTag()).toString())
)), )),
((c, t) -> new StringValue(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand")), ((c, t) -> new StringValue(enumhand == Hand.MAIN_HAND ? "mainhand" : "offhand")),
@@ -770,7 +770,7 @@ public class CarpetExpression
BlockEntity be = world.getBlockEntity(where); BlockEntity be = world.getBlockEntity(where);
world.clearBlockState(where, false); world.clearBlockState(where, false);
ItemStack itemstack2 = player.getMainHandStack(); ItemStack itemstack2 = player.getMainHandStack();
itemstack2.onBlockBroken(player.world, state, where, player); itemstack2.postMine(player.world, state, where, player);
ItemStack itemstack1 = itemstack2.isEmpty() ? ItemStack.EMPTY : itemstack2.copy(); ItemStack itemstack1 = itemstack2.isEmpty() ? ItemStack.EMPTY : itemstack2.copy();
state.getBlock().afterBreak(world, player, where,state, be, itemstack1); state.getBlock().afterBreak(world, player, where,state, be, itemstack1);
world.playLevelEvent(null, 2001, where, Block.getRawIdFromState(state)); world.playLevelEvent(null, 2001, where, Block.getRawIdFromState(state));
@@ -178,8 +178,8 @@ public class EntityValue extends Value
put("width", (e, a) -> new NumericValue(e.getSize(EntityPose.STANDING).width)); put("width", (e, a) -> new NumericValue(e.getSize(EntityPose.STANDING).width));
put("eye_height", (e, a) -> new NumericValue(e.getEyeHeight(EntityPose.STANDING))); put("eye_height", (e, a) -> new NumericValue(e.getEyeHeight(EntityPose.STANDING)));
put("age", (e, a) -> new NumericValue(e.age)); put("age", (e, a) -> new NumericValue(e.age));
put("item", (e, a) -> (e instanceof ItemEntity)?new StringValue(((ItemEntity) e).getStack().getDisplayName().getString()):Value.NULL); put("item", (e, a) -> (e instanceof ItemEntity)?new StringValue(((ItemEntity) e).getStack().getCustomName().getString()):Value.NULL);
put("count", (e, a) -> (e instanceof ItemEntity)?new NumericValue(((ItemEntity) e).getStack().getAmount()):Value.NULL); put("count", (e, a) -> (e instanceof ItemEntity)?new NumericValue(((ItemEntity) e).getStack().getCount()):Value.NULL);
// ItemEntity -> despawn timer via ssGetAge // ItemEntity -> despawn timer via ssGetAge
put("is_baby", (e, a) -> (e instanceof LivingEntity)?new NumericValue(((LivingEntity) e).isBaby()):Value.NULL); put("is_baby", (e, a) -> (e instanceof LivingEntity)?new NumericValue(((LivingEntity) e).isBaby()):Value.NULL);
put("target", (e, a) -> { put("target", (e, a) -> {
@@ -279,7 +279,7 @@ public class EntityValue extends Value
{ {
return ListValue.of( return ListValue.of(
new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()), new StringValue(Registry.ITEM.getId(itemstack.getItem()).getPath()),
new NumericValue(itemstack.getAmount()), new NumericValue(itemstack.getCount()),
new StringValue(itemstack.toTag(new CompoundTag()).toString()) new StringValue(itemstack.toTag(new CompoundTag()).toString())
); );
} }
+1 -1
View File
@@ -39,7 +39,7 @@ public class EntityInfo
{ {
return null; return null;
} // func_190916_E() } // func_190916_E()
String stackname = item.getAmount()>1?String.format("%dx%s",item.getAmount(), item.getDisplayName().getString()):item.getDisplayName().getString(); String stackname = item.getCount()>1?String.format("%dx%s",item.getCount(), item.getCustomName().getString()):item.getCustomName().getString();
if (item.isDamaged()) if (item.isDamaged())
{ {
stackname += String.format(" %d/%d", item.getMaxUseTime()-item.getDamage(), item.getMaxUseTime()); stackname += String.format(" %d/%d", item.getMaxUseTime()-item.getDamage(), item.getMaxUseTime());
-1
View File
@@ -70,7 +70,6 @@
"FloatingIslandsChunkGeneratorMixin", "FloatingIslandsChunkGeneratorMixin",
"EndCityFeatureMixin", "EndCityFeatureMixin",
"SpawnRestrictionMixin",
"InfestedBlockMixin", "InfestedBlockMixin",
"PlayerEntityMixin" "PlayerEntityMixin"