Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Syconn

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Syconn's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello I am trying to find all the chest in a 15x15x15 area and then plug them into a list, to store but when I print them into console it some completely different cords. public class MessageGetItems implements IMessage<MessageGetItems> { public MessageGetItems() { } @Override public void encode(MessageGetItems message, PacketBuffer buffer) { } @Override public MessageGetItems decode(PacketBuffer buffer) { return new MessageGetItems(); } @Override public void handle(MessageGetItems message, Supplier<NetworkEvent.Context> supplier) { supplier.get().enqueueWork(() -> { ServerPlayerEntity player = supplier.get().getSender(); if (player != null){ ServerWorld world = player.getServerWorld(); DroneEntity drone = null; List<DroneEntity> droneEntities = world.getEntitiesWithinAABB(ModEntities.DRONE, player.getBoundingBox().grow(20), drones -> drones.isTamed() && drones.getOwnerId() != null && drones.getOwnerId().equals(player.getUniqueID())); drone = droneEntities.stream().min(Comparator.comparing(player::getDistance)).orElse(null); BlockPos chests = null; for (BlockPos pos : BlockPos.getAllInBoxMutable(getArea(player).minX, getArea(player).minY, getArea(player).minZ, getArea(player).maxX, getArea(player).maxY, getArea(player).maxZ)) { if (getStorage(pos, world) != null) { chests = pos; } } if (!drone.findChests().isEmpty()) { System.out.println(chests); return; } else player.sendMessage(new TranslationTextComponent(TextFormatting.RED + "There are mo nearby chest"), ChatType.GAME_INFO); } }); supplier.get().setPacketHandled(true); } private TileEntity getStorage(BlockPos pos, ServerWorld world) { TileEntity tileEntity = world.getTileEntity(pos); if(tileEntity instanceof IInventory) { return tileEntity; } return null; } private MutableBoundingBox getArea(PlayerEntity player) { int distanceForChest = 15; return new MutableBoundingBox((int) player.getPosX() - distanceForChest, (int) player.getPosY() - distanceForChest, (int) player.getPosZ() - distanceForChest, (int) player.getPosX() + distanceForChest, (int) player.getPosY() + distanceForChest, (int) player.getPosZ() + distanceForChest); } } and I see this
  2. I was playing around with config files and when I clicked on my mod in mod options it crashed. This is the report: [12:57:43] [main/FATAL] [ne.mi.fo.la.MavenVersionAdapter/]: Failed to parse version spec [1.15.2,1.6] org.apache.maven.artifact.versioning.InvalidVersionSpecificationException: Range defies version ordering: [1.15.2,1.6] at org.apache.maven.artifact.versioning.VersionRange.parseRestriction(VersionRange.java:232) ~[maven-artifact-3.6.3.jar:3.6.3] {} at org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(VersionRange.java:145) ~[maven-artifact-3.6.3.jar:3.6.3] {} at net.minecraftforge.forgespi.language.MavenVersionAdapter.createFromVersionSpec(MavenVersionAdapter.java:33) ~[forgespi-2.1.2.jar:?] {} at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_212] {} at net.minecraftforge.forgespi.language.IModInfo$ModVersion.<init>(IModInfo.java:88) ~[forgespi-2.1.2.jar:?] {} at net.minecraftforge.fml.loading.moddiscovery.ModInfo.lambda$new$4(ModInfo.java:93) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212] {} at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212] {} at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_212] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_212] {} at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212] {} at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212] {} at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212] {} at net.minecraftforge.fml.loading.moddiscovery.ModInfo.<init>(ModInfo.java:93) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at net.minecraftforge.fml.loading.moddiscovery.ModFileInfo.lambda$new$2(ModFileInfo.java:70) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212] {} at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212] {} at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_212] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_212] {} at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212] {} at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212] {} at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212] {} at net.minecraftforge.fml.loading.moddiscovery.ModFileInfo.<init>(ModFileInfo.java:70) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at net.minecraftforge.fml.loading.moddiscovery.ModFileParser.loadModFile(ModFileParser.java:59) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at net.minecraftforge.fml.loading.moddiscovery.ModFileParser.readModList(ModFileParser.java:51) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at net.minecraftforge.fml.loading.moddiscovery.ModFile.identifyMods(ModFile.java:132) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:116) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:?] {} at net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:211) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:31.2] {} at net.minecraftforge.fml.loading.FMLServiceProvider.runScan(FMLServiceProvider.java:105) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar:31.2] {} at cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:111) ~[modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:115) ~[modlauncher-5.1.0.jar:?] {} at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267) [?:1.8.0_212] {} at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1628) [?:1.8.0_212] {} at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) [?:1.8.0_212] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [?:1.8.0_212] {} at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_212] {} at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_212] {} at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) [?:1.8.0_212] {} at cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:116) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:63) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:75) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {} any help would be appreciated. Thanks.
  3. But then it renders all the mc widgets in one space in the escape menu and it makes it unable to type by changing the text
  4. I thought I had to rebind the texture
  5. Does anyone have any code I could look at.
  6. Do something like this for AimGun: Change event to TickEvent.PlayerTickEvent Use event.player to get player and get capability like this: @SubscribeEvent public static void tick(TickEvent.PlayerTickEvent event) { [YourIinterface] data = event.player.getCapability(ProviderGunActions.GUN_ACTIONS_CAP).orElseThrow(IllegalStateException::new); }
  7. This is how I add a item to a slot but you could reverse it. https://github.com/Syconn/Syconn-Star-Wars-Mod/blob/master/src/main/java/mod/syconn/starwars/network/message/MessageCraftLightsaber.java
  8. Can we see your PacketUpgrader class.
  9. Try doing some like this: YourInterface data = armour.getCapability(SlottedArmorProvider.ARMOR_CAPABILITY).orElseThrow(IllegalStateException::new);
  10. I have been working on a custom overlay for my mod. It looks like this: but when I open the escape menu it looks like this: My code is this: @OnlyIn(value = Dist.CLIENT) public class ForcePowersOverlay { private Minecraft minecraft; private static final ResourceLocation tex = new ResourceLocation(Reference.MOD_ID, "textures/gui/mod_widgets.png"); public ForcePowersOverlay() { minecraft = Minecraft.getInstance(); } @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { if(event.getType() == RenderGameOverlayEvent.ElementType.ALL) { renderCustomOverlay(); } } private void renderCustomOverlay(){ PlayerEntity player = (PlayerEntity)this.minecraft.getRenderViewEntity(); if (player != null) { IForceSensitive data = player.getCapability(ModCapabilities.FORCE_CAPABILITY).orElseThrow(IllegalStateException::new); int slotX = data.getSlot() * 20; int scaledWidth = this.minecraft.getMainWindow().getScaledWidth(); int scaledHeight = this.minecraft.getMainWindow().getScaledHeight(); RenderSystem.pushMatrix(); RenderSystem.pushTextureAttributes(); RenderSystem.enableAlphaTest(); RenderSystem.enableBlend(); RenderSystem.color4f(1F, 1F, 1F, 1F); minecraft.getTextureManager().bindTexture(tex); //Slots minecraft.ingameGUI.blit(40, scaledHeight - 22, 0, 0, 62, 21); //SelectedSlot minecraft.ingameGUI.blit(40 + slotX, scaledHeight - 23, 62, 0, 24, 22); //Push minecraft.ingameGUI.blit(44, scaledHeight - 18, 4, 25, 15, 15); //Epicenter minecraft.ingameGUI.blit(64, scaledHeight - 18, 23, 25, 15, 15); //Heal minecraft.ingameGUI.blit(84, scaledHeight - 18, 42, 25, 15, 15); //minecraft.getRenderManager().getFontRenderer().drawString(data.getSide().getName(), 8.0f, 6.0f, 410752); minecraft.getTextureManager().bindTexture(AbstractGui.BACKGROUND_LOCATION); RenderSystem.popAttributes(); RenderSystem.popMatrix(); } } Any help would be great thanks.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.