Skip to content

Commit

Permalink
Removing commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
cakeGit committed Aug 1, 2024
1 parent e1fca9d commit d73a546
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,7 @@
public class DeployerMovementBehaviorMixin {

private ItemStack currentBlueprint;
// private Contraption currentContraption;
// private Level currentLevel;
// private BlockPos currentBlockPos;
//
//
// @Inject(method = "activateAsSchematicPrinter", at = @At("HEAD"))
// public void head_activateAsSchematicPrinter(MovementContext context, BlockPos blockPos, DeployerFakePlayer player, Level world, ItemStack filter, CallbackInfo ci) {
// currentContraption = context.contraption;
// currentBlockPos = blockPos;
// currentLevel = world;
// }
//

@Redirect(method = "activate", at = @At(value = "INVOKE", target = "Lcom/tterrag/registrate/util/entry/ItemEntry;isIn(Lnet/minecraft/world/item/ItemStack;)Z", remap = true))
public boolean isIn(ItemEntry<SchematicItem> instance, ItemStack stack) {
currentBlueprint = stack;
Expand All @@ -50,9 +39,6 @@ public boolean isInside(BoundingBox instance, Vec3i vec3i) {
@Redirect(method = "activateAsSchematicPrinter", at = @At(value = "INVOKE", target = "Lcom/simibubi/create/content/schematics/SchematicWorld;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;", remap = true))
public BlockState getBlockState(SchematicWorld instance, BlockPos globalPos) {
if (instance instanceof PatternSchematicWorld patternSchematicWorld) {
// System.out.println(globalPos);
// System.out.println(pattern_Schematics$getSourceOfLocal(globalPos, patternSchematicWorld));
// System.out.println(instance.getBlockState(pattern_Schematics$getSourceOfLocal(globalPos, patternSchematicWorld)));
return instance.getBlockState(pattern_Schematics$getSourceOfLocal(globalPos, patternSchematicWorld));
}
else return instance.getBlockState(globalPos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,6 @@ private void loadSchematic(ItemStack blueprint, Level originalWorld, boolean pro
}
}

// @Redirect(method = "loadSchematic", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate;getSize()Lnet/minecraft/core/Vec3i;"))
// private Vec3i getBounds(StructureTemplate instance) {
// //For pattern schematics template.getbounds != world.getbounds
// Vec3i size = lastThreadStructureTemplate.getSize();
////
//// if (blockReader instanceof PatternSchematicWorld patternSchematicWorld)
//// return Vec3iUtils.multiplyVec3i(
//// size, new Vec3i(1, 1, 1)
//// .subtract(patternSchematicWorld.cloneScaleMin)
//// .offset(patternSchematicWorld.cloneScaleMax)
//// );
//// else
// return size;
// }

ServerLevelAccessor lastWorld;
StructurePlaceSettings lastPlaceSettings;

Expand All @@ -86,15 +71,12 @@ private boolean loadSchem(StructureTemplate instance, ServerLevelAccessor world,
minScale = Vec3iUtils.min(scale1, scale2);
maxScale = Vec3iUtils.max(scale1, scale2);

int k = 0;
for (int x = minScale.getX(); x <= maxScale.getX(); x++) {
for (int y = minScale.getY(); y <= maxScale.getY(); y++) {
for (int z = minScale.getZ(); z <= maxScale.getZ(); z++) {
BlockPos anchor = blockPos1.offset(
Vec3iUtils.multiplyVec3i(new Vec3i(x, y, z), patternSchematicWorld.sourceBounds.getLength().offset(1, 1, 1))
);
k++;
// System.out.println("placed" + k + "" + Vec3iUtils.multiplyVec3i(new Vec3i(x, y, z), patternSchematicWorld.sourceBounds.getLength().offset(1, 1, 1)));
instance.placeInWorld(world, anchor, anchor, placeSettings, randomSource, i);
}
}
Expand Down

0 comments on commit d73a546

Please sign in to comment.