|
1 | 1 | package gregtech.api.pattern; |
2 | 2 |
|
3 | | -import gregtech.api.GregTechAPI; |
4 | 3 | import gregtech.api.metatileentity.MetaTileEntity; |
5 | 4 | import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; |
6 | 5 | import gregtech.api.metatileentity.multiblock.MultiblockControllerBase; |
7 | | -import gregtech.api.metatileentity.registry.MTERegistry; |
8 | 6 | import gregtech.api.util.BlockInfo; |
| 7 | +import gregtech.api.util.GTUtility; |
9 | 8 | import gregtech.api.util.RelativeDirection; |
10 | 9 |
|
11 | 10 | import net.minecraft.block.state.IBlockState; |
@@ -164,9 +163,6 @@ private PatternMatchContext checkPatternAt(World world, BlockPos centerPos, Enum |
164 | 163 | for (int b = 0, y = -centerOffset[1]; b < this.thumbLength; b++, y++) { |
165 | 164 | for (int a = 0, x = -centerOffset[0]; a < this.palmLength; a++, x++) { |
166 | 165 | TraceabilityPredicate predicate = this.blockMatches[c][b][a]; |
167 | | - // this is expecting the te pos to not be set? |
168 | | - // this should be 0, 0, 0 |
169 | | - // EBF front facing was SOUTH instead of NORTH |
170 | 166 | BlockPos pos = RelativeDirection.setActualRelativeOffset(x, y, z, frontFacing, upwardsFacing, |
171 | 167 | isFlipped, structureDir) |
172 | 168 | .add(centerPos.getX(), centerPos.getY(), centerPos.getZ()); |
@@ -380,9 +376,7 @@ public void autoBuild(EntityPlayer player, MultiblockControllerBase controllerBa |
380 | 376 | .getStateFromMeta(itemBlock.getMetadata(found.getMetadata())); |
381 | 377 | blocks.put(pos, state); |
382 | 378 | world.setBlockState(pos, state); |
383 | | - MTERegistry registry = GregTechAPI.mteManager |
384 | | - .getRegistry(found.getItem().getRegistryName().getNamespace()); |
385 | | - MetaTileEntity sampleMetaTileEntity = registry.getObjectById(found.getItemDamage()); |
| 379 | + MetaTileEntity sampleMetaTileEntity = GTUtility.getMetaTileEntity(found); |
386 | 380 | if (sampleMetaTileEntity != null) { |
387 | 381 | MetaTileEntity metaTileEntity = sampleMetaTileEntity.copy(); |
388 | 382 | metaTileEntity.onPlacement(player); |
|
0 commit comments