19w36a
This commit is contained in:
1 parent
2fcef289f0
commit
addb836b21
12 files changed
+67
-14
No files matched your search
@@ -16,6 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(PortalBlock.class)
|
||||
public class PortalBlock_portalCachingMixin
|
||||
{
|
||||
/*
|
||||
@Inject(method = "createPortalAt", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/PortalBlock$AreaHelper;createPortal()V"
|
||||
@@ -39,5 +40,6 @@ public class PortalBlock_portalCachingMixin
|
||||
((PortalForcerInterface)((ServerWorld)iWorld_1).getPortalForcer()).invalidateCache();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -21,8 +21,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(PortalForcer.class)
|
||||
public class PortalForcer_portalCachingMixin implements PortalForcerInterface
|
||||
public abstract class PortalForcer_portalCachingMixin implements PortalForcerInterface
|
||||
{
|
||||
/*
|
||||
@Shadow @Final private ServerWorld world;
|
||||
private Map<ColumnPos, Object> storedTicketInfos = new HashMap<>();
|
||||
|
||||
@@ -42,7 +43,7 @@ public class PortalForcer_portalCachingMixin implements PortalForcerInterface
|
||||
value = "INVOKE",
|
||||
target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;"
|
||||
))
|
||||
private Object /* private TicketInfo */ getTicketInfo(Map map, Object /* ColumnPos */ key)
|
||||
private Object / private TicketInfo / getTicketInfo(Map map, Object / ColumnPos / key)
|
||||
{
|
||||
//Do the dance with ticketinfos. If vanilla has one, we gonna borrow, if vanilla is missing, we supply
|
||||
if (!CarpetSettings.portalCaching)
|
||||
@@ -69,10 +70,11 @@ public class PortalForcer_portalCachingMixin implements PortalForcerInterface
|
||||
value = "INVOKE",
|
||||
target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"
|
||||
))
|
||||
private Object /* TicketInfo */ putNewTicket(Map map, Object /*ColumnPos */ key, Object /*TicketInfo */ value)
|
||||
private Object / TicketInfo / putNewTicket(Map map, Object /ColumnPos / key, Object /TicketInfo / value)
|
||||
{
|
||||
if (CarpetSettings.portalCaching)
|
||||
storedTicketInfos.put((ColumnPos) key, value);
|
||||
return map.put(key, value);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class PortalForcer_portalSuffocationMixin
|
||||
}
|
||||
|
||||
|
||||
@Redirect(method = "getPortal",at = @At(
|
||||
@Redirect(method = "method_22391",at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/pattern/BlockPattern$Result;method_18478(Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;DLnet/minecraft/util/math/Vec3d;D)Lnet/minecraft/block/pattern/BlockPattern$TeleportTarget;"
|
||||
))
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(StructureBlockBlockEntity.class)
|
||||
public abstract class StructureBlockBlockEntity_fillUpdatesMixin
|
||||
{
|
||||
@Redirect(method = "method_21864", at = @At(
|
||||
@Redirect(method = "place", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;)V"
|
||||
))
|
||||
|
||||
@@ -115,8 +115,8 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface
|
||||
return structurestart;
|
||||
}
|
||||
}
|
||||
Biome biome_1 = generator.getBiomeSource().getBiome(new BlockPos(chunkpos.getStartX() + 9, 0, chunkpos.getStartZ() + 9));
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, biome_1, MutableIntBoundingBox.empty(),0,generator.getSeed());
|
||||
Biome biome_1 = generator.getBiomeSource().getBiome(chunkpos.getStartX() + 9, 0, chunkpos.getStartZ() + 9);
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, MutableIntBoundingBox.empty(),0,generator.getSeed());
|
||||
structurestart1.initialize(generator, ((ServerWorld)worldIn).getStructureManager() , chunkpos.x, chunkpos.z, biome_1);
|
||||
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.fakes.class_4548Interface;
|
||||
import net.minecraft.class_4548;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import static net.minecraft.class_4548.field_20650;
|
||||
import static net.minecraft.class_4548.field_20651;
|
||||
|
||||
@Mixin(class_4548.class)
|
||||
public class class_4548_getBiomeArrayMixin implements class_4548Interface
|
||||
{
|
||||
|
||||
@Shadow @Final private Biome[] field_20654;
|
||||
|
||||
@Shadow @Final private static int field_20652;
|
||||
|
||||
@Override
|
||||
public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
|
||||
{
|
||||
ChunkPos chunkPos = new ChunkPos(pos);
|
||||
int seaLevel = world.getSeaLevel();
|
||||
int int_4 = chunkPos.x & field_20650;
|
||||
int int_5 = MathHelper.clamp(seaLevel, 0, field_20651);
|
||||
int int_6 = chunkPos.z & field_20650;
|
||||
field_20654[int_5 << field_20652 + field_20652 | int_6 << field_20652 | int_4] = what;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user