mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +00:00 
			
		
		
		
	Backwards compat patch for Plethora
Ughghgghghr.
This commit is contained in:
		| @@ -200,6 +200,7 @@ public final class Registry | ||||
|  | ||||
|         registerTurtleUpgrades(); | ||||
|         registerPocketUpgrades(); | ||||
|         registerLegacyUpgrades(); | ||||
|     } | ||||
|  | ||||
|     @SubscribeEvent | ||||
| @@ -336,6 +337,13 @@ public final class Registry | ||||
|         ComputerCraftAPI.registerPocketUpgrade( ComputerCraft.PocketUpgrades.speaker ); | ||||
|     } | ||||
|  | ||||
|     @SuppressWarnings( "deprecation" ) | ||||
|     private static void registerLegacyUpgrades() | ||||
|     { | ||||
|         ComputerCraft.PocketUpgrades.pocketSpeaker = ComputerCraft.PocketUpgrades.speaker; | ||||
|         ComputerCraft.Upgrades.advancedModem = ComputerCraft.TurtleUpgrades.advancedModem; | ||||
|     } | ||||
|  | ||||
|     @SubscribeEvent | ||||
|     public static void remapItems( RegistryEvent.MissingMappings<Item> mappings ) | ||||
|     { | ||||
|   | ||||
| @@ -16,6 +16,7 @@ import net.minecraft.server.MinecraftServer; | ||||
| import net.minecraft.util.ResourceLocation; | ||||
| import net.minecraft.util.SoundCategory; | ||||
| import net.minecraft.util.SoundEvent; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| import net.minecraft.util.math.Vec3d; | ||||
| import net.minecraft.world.World; | ||||
|  | ||||
| @@ -39,7 +40,13 @@ public abstract class SpeakerPeripheral implements IPeripheral | ||||
|  | ||||
|     public abstract World getWorld(); | ||||
|  | ||||
|     public abstract Vec3d getPos(); | ||||
|     public abstract Vec3d getPosition(); | ||||
|  | ||||
|     @Deprecated | ||||
|     public BlockPos getPos() | ||||
|     { | ||||
|         return new BlockPos( getPosition() ); | ||||
|     } | ||||
|  | ||||
|     public boolean madeSound( long ticks ) | ||||
|     { | ||||
| @@ -125,7 +132,7 @@ public abstract class SpeakerPeripheral implements IPeripheral | ||||
|         } | ||||
|  | ||||
|         World world = getWorld(); | ||||
|         Vec3d pos = getPos(); | ||||
|         Vec3d pos = getPosition(); | ||||
|  | ||||
|         context.issueMainThreadTask( () -> { | ||||
|             MinecraftServer server = world.getMinecraftServer(); | ||||
|   | ||||
| @@ -59,7 +59,7 @@ public class TileSpeaker extends TilePeripheralBase | ||||
|         } | ||||
|  | ||||
|         @Override | ||||
|         public Vec3d getPos() | ||||
|         public Vec3d getPosition() | ||||
|         { | ||||
|             BlockPos pos = speaker.getPos(); | ||||
|             return new Vec3d( pos.getX(), pos.getY(), pos.getZ() ); | ||||
|   | ||||
| @@ -29,7 +29,7 @@ public class PocketSpeakerPeripheral extends SpeakerPeripheral | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public Vec3d getPos() | ||||
|     public Vec3d getPosition() | ||||
|     { | ||||
|         return world != null ? position : null; | ||||
|     } | ||||
|   | ||||
| @@ -48,7 +48,7 @@ public class TurtleSpeaker extends AbstractTurtleUpgrade | ||||
|         } | ||||
|  | ||||
|         @Override | ||||
|         public Vec3d getPos() | ||||
|         public Vec3d getPosition() | ||||
|         { | ||||
|             BlockPos pos = turtle.getPosition(); | ||||
|             return new Vec3d( pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SquidDev
					SquidDev