• Recently Browsing

    No registered users viewing this page.

  • Posts

    • howdy   Some of your method signatures weren't right and one of your imports (for Supplier) was wrong.   The fixed classes (compiles fine now):   /** * */ package genelectrovise.magiksmostevile.common.network.altar; import com.google.common.base.Optional; import genelectrovise.magiksmostevile.common.main.MagiksMostEvile; import net.minecraft.network.play.server.SWindowPropertyPacket; import net.minecraft.util.ResourceLocation; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.network.NetworkDirection; import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; /** * @author GenElectrovise 23 May 2020 */ public class AltarNetworkingManager { public static SimpleChannel channel; public static final ResourceLocation channelRL = new ResourceLocation(MagiksMostEvile.MODID, "altar_channel"); public static final String MESSAGE_PROTOCOL_VERSION = "1.0"; public static final int ALTAR_ENERGY_TO_SERVER = 35; // a unique ID for this message type. It helps detect errors if you don't use // zero! public static final int ALTAR_ENERGY_TO_CLIENT = 63; @SubscribeEvent public static void onCommonSetupEvent(FMLCommonSetupEvent event) { channel = NetworkRegistry.newSimpleChannel(channelRL, () -> MESSAGE_PROTOCOL_VERSION, AltarMessageHandlerOnClient::isProtocolAccepted, AltarMessageHandlerOnServer::isProtocolAccepted); //channel.registerMessage(ALTAR_ENERGY_TO_SERVER, AltarEnergyUpdateMessageToServer.class, AltarEnergyUpdateMessageToServer::encode, AltarEnergyUpdateMessageToServer::decode, Optional.of(NetworkDirection.PLAY_TO_SERVER)); channel.registerMessage(ALTAR_ENERGY_TO_CLIENT, AltarEnergyUpdateMessageToClient.class, AltarEnergyUpdateMessageToClient::encode, AltarEnergyUpdateMessageToClient::decode, AltarMessageHandlerOnClient::onMessageReceived); } }   /** * */ package genelectrovise.magiksmostevile.common.network.altar; import genelectrovise.magiksmostevile.common.main.MagiksMostEvile; import net.minecraftforge.fml.LogicalSide; import net.minecraftforge.fml.network.NetworkEvent; import java.util.function.Supplier; /** * @author GenElectrovise 24 May 2020 */ public class AltarMessageHandlerOnClient { /** * Called when a message is received of the appropriate type. CALLED BY THE * NETWORK THREAD, NOT THE CLIENT THREAD */ public static void onMessageReceived(final AltarEnergyUpdateMessageToClient message, Supplier<NetworkEvent.Context> ctxSupplier) { MagiksMostEvile.LOGGER.dev("Message recieved on client!"); ctxSupplier.get().setPacketHandled(true); if (!message.isValid()) { MagiksMostEvile.LOGGER.warn("Invalid message received on client."); return; } if (ctxSupplier.get().getDirection().getReceptionSide() != LogicalSide.CLIENT) { MagiksMostEvile.LOGGER.warn("Message recieved on incorrect side. (client) "); } // Creates a new task for the client for next tick ctxSupplier.get().enqueueWork(() -> processMessage(message)); } // This message is called from the Client thread. private static void processMessage(AltarEnergyUpdateMessageToClient message) { } public static boolean isProtocolAccepted(String protocolVersion) { return AltarNetworkingManager.MESSAGE_PROTOCOL_VERSION.equals(protocolVersion); } }   /** * */ package genelectrovise.magiksmostevile.common.network.altar; import genelectrovise.magiksmostevile.common.main.MagiksMostEvile; import net.minecraft.network.PacketBuffer; /** * This Network Message is sent from the client to the server, to tell it to * spawn projectiles at a particular location. Typical usage: PREQUISITES: have * previously setup SimpleChannel, registered the message class and the * handler.<br> * <br> * * 1) User creates an AltarEnergyUpdateMessageToServer(targetCoordinates) <br> * 2) simpleChannel.sendToServer(airstrikeMessageToServer); <br> * 3) Forge network code calls message.encode() to copy the message member * variables to a PacketBuffer, ready for sending ... bytes are sent over the * network and arrive at the server.... <br> * 4) Forge network code calls message.decode() to recreate the * airstrickeMessageToServer instance by reading from the PacketBuffer into the * member variables <br> * 5) the handler.onMessage(message) is called to process the message * * @author GenElectrovise 24 May 2020 */ public class AltarEnergyUpdateMessageToClient { private static boolean messageIsValid; public AltarEnergyUpdateMessageToClient() { messageIsValid = true; } public boolean isMessageValid() { return messageIsValid; } /** * Called by the network code. Used to write the contents of your message member * variables into the ByteBuf, ready for transmission over the network. * * @param buf */ public void encode(PacketBuffer buf) { MagiksMostEvile.LOGGER.dev("Encoding message to client"); if (!messageIsValid) return; buf.writeString("example"); } /** * Called by the network code once it has received the message bytes over the * network. Used to read the ByteBuf contents into your member variables * * @param buf */ public static AltarEnergyUpdateMessageToClient decode(PacketBuffer buf) { MagiksMostEvile.LOGGER.dev("Decoding message to client"); return new AltarEnergyUpdateMessageToClient(); } public String toString() { return "AltarEnergyUpdateMessageToClient{TODO toString}"; } public boolean isValid() { return messageIsValid; } }   Cheers   -TGG
    • So I recently have tried to try something new and change minecraft 1.10 version code. Of course, I have done decompiling. There was only one error, not counting scala -  1 out of 1 hunk FAILED -- saving rejects to file 'net\minecraft\util\math\Cartesian.java#' ok I thought, it won't do anything serious. Then there came second error.   '"C:\Program Files\Java\jdk-14.0.1\bin\javac" -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "jars\versions\1.10\1.10.jar;lib;lib\*;jars\libraries\com\google\code\findbugs\jsr305\3.0.1\jsr305-3.0.1.jar;jars\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;jars\libraries\org\lwjgl\lwjgl\lwjgl-platform\2.9.4-nightly-20150209\lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar;jars\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar;jars\libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;jars\libraries\org\apache\logging\log4j\log4j-api\2.0-beta9\log4j-api-2.0-beta9.jar;jars\libraries\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar;jars\libraries\net\java\dev\jna\jna\3.4.0\jna-3.4.0.jar;jars\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;jars\libraries\net\sf\jopt-simple\jopt-simple\4.6\jopt-simple-4.6.jar;jars\libraries\com\google\guava\guava\17.0\guava-17.0.jar;jars\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar;jars\libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;jars\libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;jars\libraries\it\unimi\dsi\fastutil\7.0.12_mojang\fastutil-7.0.12_mojang.jar;jars\libraries\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar;jars\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;jars\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;jars\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;jars\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar;jars\libraries\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;jars\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;jars\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;jars\libraries\org\lwjgl\lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar;jars\libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;jars\libraries\com\mojang\realms\1.9.1\realms-1.9.1.jar;jars\libraries\com\mojang\authlib\1.5.22\authlib-1.5.22.jar;jars\libraries\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;jars\libraries\com\mojang\netty\1.6\netty-1.6.jar;jars\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;jars\libraries\net\java\jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar;jars\libraries\org\apache\logging\log4j\log4j-core\2.0-beta9\log4j-core-2.0-beta9.jar;jars\libraries\io\netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar" -sourcepath src\minecraft -d bin\minecraft @temp\java_src_client.txt' failed : 2 == ERRORS FOUND in JAVA CODE == error: Source option 6 is no longer supported. Use 7 or later. error: Target option 6 is no longer supported. Use 7 or later. ================== Initial client recompile failed, correct source then run updatemd5   There I got scared. I've downloaded Eclipse. I've got into the files, I had everything. But. I couldn't run the minecraft. There were two errors. One was about the server: Project 'Server' is missing required library: 'jars/minecraft_server1.10.jar' And the second one: Project 'Client' is missing required library: 'jars/libraries/com/mojang/realms/1.9.0/realms-1.9.0.jar' I've added the file realms.1.9.0 to the path the Eclipse gave me with client. I've put the server files. And then, when I tried to run the minecraft one more time, there came, I don't know from where, these errors (see png's attached) Does anyone here know how to get these missing libraries or what the hell is that?
    • I tried to implement this by modifing the container on GuiOpenEvent and PlayerContainerEvent.Open  but i sadly discovered that  PlayerContainerEvent.Open doesn't fire for the Container of the player then how can i say "when i press E open my container"?    Here is the code of events: @SubscribeEvent public static void onDolphinContainerOpen(PlayerContainerEvent.Open event) { // Never fires :C ServerPlayerEntity playerEntity = (ServerPlayerEntity) event.getPlayer(); if(playerEntity.getRidingEntity() instanceof RidableDolphinEnitity) { RidableDolphinEnitity dolphin = (RidableDolphinEnitity) playerEntity.getRidingEntity(); playerEntity.openContainer = new RidableDolphinContainer(playerEntity.currentWindowId, playerEntity.inventory, dolphin.getInventory()); } } @SubscribeEvent public static void onDolphinGuiOpen(GuiOpenEvent event) { if(event.getGui() instanceof ContainerScreen) { ClientPlayerEntity player = Minecraft.getInstance().player; if (player != null && player.getRidingEntity() instanceof RidableDolphinEnitity) { RidableDolphinEnitity dolphin = (RidableDolphinEnitity) player.getRidingEntity(); if(!(event.getGui() instanceof RidableDolphinScreen)) { ContainerScreen<?> oldScreen = (ContainerScreen) event.getGui(); Container oldContainer = oldScreen.getContainer(); RidableDolphinContainer container = new RidableDolphinContainer(oldContainer.windowId, player.inventory, dolphin.getInventory()); RidableDolphinScreen screen = new RidableDolphinScreen(container, player.inventory, dolphin.getDisplayName()); player.openContainer = container; event.setGui(screen); } } } }  
    • I need help. I programmed my mod and made it in the mods folder on my server and everything started fine. But if a player joint comes this message and you will be kicked out. Here is the message: ,, Requires version 1.0.0 but mod is not found on client. " Thank you!
  • Topics

  • Who's Online (See full list)