Jump to content

Recommended Posts

Posted

I get this error when joining the eclipse server:

 

[19:04:47] [Client thread/INFO]: Connecting to localhost, 25565

[19:04:49] [Client thread/FATAL]: Reported exception thrown!

net.minecraft.util.ReportedException: Ticking screen

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1765) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:961) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]

at GradleStart.bounce(GradleStart.java:107) [start/:?]

at GradleStart.startClient(GradleStart.java:100) [start/:?]

at GradleStart.main(GradleStart.java:55) [start/:?]

Caused by: java.lang.NullPointerException

at com.mojang.util.UUIDTypeAdapter.fromUUID(UUIDTypeAdapter.java:22) ~[uUIDTypeAdapter.class:?]

at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:13) ~[uUIDTypeAdapter.class:?]

at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:10) ~[uUIDTypeAdapter.class:?]

at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) ~[TypeAdapterRuntimeTypeWrapper.class:?]

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) ~[ReflectiveTypeAdapterFactory$1.class:?]

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]

at com.google.gson.Gson.toJson(Gson.java:593) ~[Gson.class:?]

at com.google.gson.Gson.toJson(Gson.java:572) ~[Gson.class:?]

at com.google.gson.Gson.toJson(Gson.java:527) ~[Gson.class:?]

at com.google.gson.Gson.toJson(Gson.java:507) ~[Gson.class:?]

at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[YggdrasilAuthenticationService.class:?]

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.joinServer(YggdrasilMinecraftSessionService.java:76) ~[YggdrasilMinecraftSessionService.class:?]

at net.minecraft.client.network.NetHandlerLoginClient.handleEncryptionRequest(NetHandlerLoginClient.java:62) ~[NetHandlerLoginClient.class:?]

at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:54) ~[s01PacketEncryptionRequest.class:?]

at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:62) ~[s01PacketEncryptionRequest.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) ~[NetworkManager.class:?]

at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116) ~[GuiConnecting.class:?]

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751) ~[Minecraft.class:?]

... 16 more

---- Minecraft Crash Report ----

// I blame Dinnerbone.

 

Time: 8/16/14 7:04 PM

Description: Ticking screen

 

java.lang.NullPointerException: Ticking screen

at com.mojang.util.UUIDTypeAdapter.fromUUID(UUIDTypeAdapter.java:22)

at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:13)

at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:10)

at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)

at com.google.gson.Gson.toJson(Gson.java:593)

at com.google.gson.Gson.toJson(Gson.java:572)

at com.google.gson.Gson.toJson(Gson.java:527)

at com.google.gson.Gson.toJson(Gson.java:507)

at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54)

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.joinServer(YggdrasilMinecraftSessionService.java:76)

at net.minecraft.client.network.NetHandlerLoginClient.handleEncryptionRequest(NetHandlerLoginClient.java:62)

at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:54)

at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:62)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247)

at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038)

at net.minecraft.client.Minecraft.run(Minecraft.java:961)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:55)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at com.mojang.util.UUIDTypeAdapter.fromUUID(UUIDTypeAdapter.java:22)

at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:13)

at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:10)

at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)

at com.google.gson.Gson.toJson(Gson.java:593)

at com.google.gson.Gson.toJson(Gson.java:572)

at com.google.gson.Gson.toJson(Gson.java:527)

at com.google.gson.Gson.toJson(Gson.java:507)

at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54)

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.joinServer(YggdrasilMinecraftSessionService.java:76)

at net.minecraft.client.network.NetHandlerLoginClient.handleEncryptionRequest(NetHandlerLoginClient.java:62)

at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:54)

at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:62)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247)

at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116)

 

-- Affected screen --

Details:

Screen name: net.minecraft.client.multiplayer.GuiConnecting

Stacktrace:

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038)

at net.minecraft.client.Minecraft.run(Minecraft.java:961)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:55)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.8.0_11, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 958596368 bytes (914 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available

FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available

Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available

zero_quest{v1.0.0} [Zero Quest] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: AMD Radeon HD 6620G GL version 4.4.12874 Compatibility Profile Context 14.100.0.0, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (UK)

Profiler Position: N/A (disabled)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: On (16)

#@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Ilise Leary\Desktop\ModStuff\forge-1.7.10-10.13.0.1180-src\eclipse\.\crash-reports\crash-2014-08-16_19.04.49-client.txt

AL lib: (EE) alc_cleanup: 1 device not closed

Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

Im not sure why im getting this error. Can someone help? My source code for my mod is on https://github.com/NViper21/ZeroQuest/tree/master/1.7.10-src

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Posted

Bump I can't figure out why it's not working right on the server

 

Here is my Client Proxy

 

package common.zeroquest.core.proxy;

 

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.item.Item;

import net.minecraftforge.client.MinecraftForgeClient;

import common.zeroquest.ModBlocks;

import common.zeroquest.ModItems;

import common.zeroquest.client.model.ModelDarkZertum;

import common.zeroquest.client.model.ModelDestroZertum;

import common.zeroquest.client.model.ModelJakan;

import common.zeroquest.client.model.ModelKortor;

import common.zeroquest.client.model.ModelKurr;

import common.zeroquest.client.model.ModelRedZertum;

import common.zeroquest.client.model.ModelZertum;

import common.zeroquest.client.render.RenderDarkZertum;

import common.zeroquest.client.render.RenderDestroZertum;

import common.zeroquest.client.render.RenderFPoisonball;

import common.zeroquest.client.render.RenderGrenade;

import common.zeroquest.client.render.RenderJakan;

import common.zeroquest.client.render.RenderKortor;

import common.zeroquest.client.render.RenderKurr;

import common.zeroquest.client.render.RenderRedZertum;

import common.zeroquest.client.render.RenderZertum;

import common.zeroquest.client.renderer.ItemRendererNileTable;

import common.zeroquest.client.renderer.RendererNileTable;

import common.zeroquest.entity.EntityDarkZertum;

import common.zeroquest.entity.EntityDestroZertum;

import common.zeroquest.entity.EntityJakan;

import common.zeroquest.entity.EntityKortor;

import common.zeroquest.entity.EntityKurr;

import common.zeroquest.entity.EntityRedZertum;

import common.zeroquest.entity.EntityZertum;

import common.zeroquest.entity.projectile.EntityFlamingPoisonball;

import common.zeroquest.entity.projectile.EntityGrenade;

import common.zeroquest.tileentity.TileEntityNileTable;

import cpw.mods.fml.client.registry.ClientRegistry;

import cpw.mods.fml.client.registry.RenderingRegistry;

 

public class ClientProxy extends CommonProxy{

 

 

public void registerRenderThings() {

  RenderingRegistry.registerEntityRenderingHandler(EntityZertum.class, new RenderZertum(new ModelZertum(), 0.5F));

  RenderingRegistry.registerEntityRenderingHandler(EntityRedZertum.class, new RenderRedZertum(new ModelRedZertum(), 0.5F));

  RenderingRegistry.registerEntityRenderingHandler(EntityDarkZertum.class, new RenderDarkZertum(new ModelDarkZertum(), 0.5F));

  RenderingRegistry.registerEntityRenderingHandler(EntityDestroZertum.class, new RenderDestroZertum(new ModelDestroZertum(), 0.5F));

  RenderingRegistry.registerEntityRenderingHandler(EntityJakan.class, new RenderJakan(new ModelJakan(), 1.0F));

  //RenderingRegistry.registerEntityRenderingHandler(EntityJakanPrime.class, new RenderJakanPrime(new ModelJakanPrime(), 1.0F));

 

  RenderingRegistry.registerEntityRenderingHandler(EntityKurr.class, new RenderKurr(new ModelKurr(), 1.0F));

  RenderingRegistry.registerEntityRenderingHandler(EntityKortor.class, new RenderKortor(new ModelKortor(), 1.0F));

 

  RenderingRegistry.registerEntityRenderingHandler(EntityFlamingPoisonball.class, new RenderFPoisonball(1));

  RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade(ModItems.nileGrenade));

  TileEntitySpecialRenderer render = new RendererNileTable();

  ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNileTable.class, render);

MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.nileWorktable), new ItemRendererNileTable(render, new TileEntityNileTable()));

}

}

 

 

 

Common Proxy

 

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemStack;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.WeightedRandomChestContent;

import net.minecraft.world.World;

import net.minecraftforge.common.ChestGenHooks;

import common.zeroquest.ModItems;

import common.zeroquest.client.gui.GuiDarkPack;

import common.zeroquest.client.gui.GuiDestroPack;

import common.zeroquest.client.gui.GuiJakanPack;

import common.zeroquest.client.gui.GuiPack;

import common.zeroquest.client.gui.GuiRedPack;

import common.zeroquest.client.gui.NileTableGui;

import common.zeroquest.entity.EntityDarkZertum;

import common.zeroquest.entity.EntityDestroZertum;

import common.zeroquest.entity.EntityJakan;

import common.zeroquest.entity.EntityRedZertum;

import common.zeroquest.entity.EntityZertum;

import common.zeroquest.inventory.ContainerDarkPack;

import common.zeroquest.inventory.ContainerDestroPack;

import common.zeroquest.inventory.ContainerJakanPack;

import common.zeroquest.inventory.ContainerNileTable;

import common.zeroquest.inventory.ContainerPack;

import common.zeroquest.inventory.ContainerRedPack;

import common.zeroquest.tileentity.TileEntityNileTable;

import cpw.mods.fml.common.network.IGuiHandler;

 

public class CommonProxy implements IGuiHandler{

 

public static final int NileTable = 0;

public static final int ZertumPack = 1;

public static final int RedZertumPack = 2;

public static final int DarkZertumPack = 3;

public static final int DestroZertumPack = 4;

public static final int JakanPack = 5;

 

 

@Override

public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

if(ID == NileTable) {

TileEntity target = world.getTileEntity(x, y, z);

if(!(target instanceof TileEntityNileTable))

return null;

 

TileEntityNileTable tileNileTable = (TileEntityNileTable)target;

ContainerNileTable tableContainer = new ContainerNileTable(tileNileTable, player.inventory, world, x, y, z);

return tableContainer;

}

else if(ID == ZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

            if(!(target instanceof EntityZertum)) {

            return null;

            }

            EntityZertum dog = (EntityZertum)target;

ContainerPack packPuppyContainer = new ContainerPack(player.inventory, dog);

return packPuppyContainer;

}

else if(ID == RedZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

            if(!(target instanceof EntityRedZertum)) {

            return null;

            }

            EntityRedZertum dog = (EntityRedZertum)target;

            ContainerRedPack packPuppyContainer = new ContainerRedPack(player.inventory, dog);

return packPuppyContainer;

}

else if(ID == DarkZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

            if(!(target instanceof EntityDarkZertum)) {

            return null;

            }

            EntityDarkZertum dog = (EntityDarkZertum)target;

            ContainerDarkPack packPuppyContainer = new ContainerDarkPack(player.inventory, dog);

return packPuppyContainer;

}

else if(ID == DestroZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

            if(!(target instanceof EntityDestroZertum)) {

            return null;

            }

            EntityDestroZertum dog = (EntityDestroZertum)target;

            ContainerDestroPack packPuppyContainer = new ContainerDestroPack(player.inventory, dog);

return packPuppyContainer;

}

else if(ID == JakanPack) {

Entity target = player.worldObj.getEntityByID(x);

            if(!(target instanceof EntityJakan)) {

            return null;

            }

            EntityJakan dog = (EntityJakan)target;

            ContainerJakanPack packPuppyContainer = new ContainerJakanPack(player.inventory, dog);

return packPuppyContainer;

}

return null;

}

 

 

@Override

public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

if(ID == NileTable) {

TileEntity target = world.getTileEntity(x, y, z);

if(!(target instanceof TileEntityNileTable))

return null;

 

TileEntityNileTable tileNileTable = (TileEntityNileTable)target;

NileTableGui tableGui = new NileTableGui(player.inventory, tileNileTable, world, x, y, z);

return tableGui;

}

else if(ID == ZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

          if(!(target instanceof EntityZertum)) {

          return null;

          }

          EntityZertum dog = (EntityZertum)target;

GuiPack packGui = new GuiPack(player.inventory, dog);

return packGui;

}

else if(ID == RedZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

          if(!(target instanceof EntityRedZertum)) {

          return null;

          }

          EntityRedZertum dog = (EntityRedZertum)target;

GuiRedPack packGui = new GuiRedPack(player.inventory, dog);

return packGui;

}

else if(ID == DestroZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

          if(!(target instanceof EntityDestroZertum)) {

          return null;

          }

          EntityDestroZertum dog = (EntityDestroZertum)target;

          GuiDestroPack packGui = new GuiDestroPack(player.inventory, dog);

return packGui;

}

else if(ID == DarkZertumPack) {

Entity target = player.worldObj.getEntityByID(x);

        if(!(target instanceof EntityDarkZertum)) {

        return null;

        }

        EntityDarkZertum dog = (EntityDarkZertum)target;

        GuiDarkPack packGui = new GuiDarkPack(player.inventory, dog);

return packGui;

}

else if(ID == JakanPack) {

Entity target = player.worldObj.getEntityByID(x);

          if(!(target instanceof EntityJakan)) {

          return null;

          }

          EntityJakan dog = (EntityJakan)target;

          GuiJakanPack packGui = new GuiJakanPack(player.inventory, dog);

return packGui;

}

return null;

}

 

    public void registerChestItems() {

        ChestGenHooks chestGenHooksDungeon = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST);

        chestGenHooksDungeon.addItem(new WeightedRandomChestContent(new ItemStack(ModItems.nileEssence), 1, 1, 30));

        // chance < saddle (1/16, ca. 6%, in max 8 slots -> 40% at least 1 egg, 0.48 eggs per chest): I think that's okay

 

        ChestGenHooks chestGenHooksMineshaft = ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR);

        chestGenHooksMineshaft.addItem(new WeightedRandomChestContent(new ItemStack(ModItems.nileEssence), 1, 1, 5));

        // chance == gold ingot (1/18, ca. 6%, in 3-6 slots -> 23% at least 1 egg, 0.27 eggs per chest):

        // exploring a random mine shaft in creative mode yielded 2 eggs out of about 10 chests in 1 hour

 

        ChestGenHooks chestGenHooksJungleChest = ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST);

        chestGenHooksJungleChest.addItem(new WeightedRandomChestContent(new ItemStack(ModItems.nileEssence), 1, 1, 15));

        // chance == gold ingot (15/81, ca. 18%, in 2-5 slots -> 51% at least 1 egg, 0.65 eggs per chest, 1.3 eggs per temple):

        // jungle temples are so rare, it should be rewarded

 

        ChestGenHooks chestGenHooksDesertChest = ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST);

        chestGenHooksDesertChest.addItem(new WeightedRandomChestContent(new ItemStack(ModItems.nileEssence), 1, 1, 10));

        // chance == iron ingot (10/76, ca. 13%, in 2-5 slots -> 39% at least 1 egg, 0.46 eggs per chest, 1.8 eggs per temple):

        // desert temples are so rare, it should be rewarded

    }

 

public void registerRenderThings() {

 

}

}

 

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Posted

I did that before i launched minecraft but it gives me an error when I try to run the client. Where do I put them at?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It is 1.12.2 - I have no idea if there is a 1.12 pack
    • Okay, but does the modpack works with 1.12 or just with 1.12.2, because I need the Forge client specifically for Minecraft 1.12, not 1.12.2
    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.