Jump to content

[1.7.2][Solved]Getting all items and checking if player is in void?


Nimbleguy

Recommended Posts

How would I get all items "alive?" I need to check if there are items in the void, then get item info and do stuff with it, but I do not know how to get all EntityItems in the world. I tried this code, but it did not work:

TickListner(Method 1):

 

 

@SubscribeEvent

public void itemDrop(ItemTossEvent e) {

System.out.println("Item Dropped");

if (e.entityItem.dimension == VoidMod.NullVoidDimID) {

System.out.println("In Void");

this.itemDropped = e.entityItem;

System.out.println(itemDropped);

}

}

 

 

TickListner(Method 2):

 

 

@SubscribeEvent

public void onTick(TickEvent.ServerTickEvent event) {

// System.out.println("OnTick");

String[] pls = MinecraftServer.getServer().getConfigurationManager()

.getAllUsernames();

EntityPlayerMP p;

for (int i = 0; i < pls.length; i++) {

p = MinecraftServer.getServer().getConfigurationManager()

.getPlayerForUsername(pls);

if (p != null) {

// System.out.println("Got a ticked player");

if (p.posY <= 0) {

// System.out.println("In the void!");

if (p.dimension == VoidMod.NullVoidDimID) {

p.setLocationAndAngles(p.posX, 256, p.posZ,

p.cameraYaw, p.cameraPitch);

}

p.addStat(VoidMod.fallVoid, 1);

}

if (p.dimension == VoidMod.NullVoidDimID) {

p.clearActivePotions();

}

}

}

World w;

Double x;

Double z;

System.out.println(itemDropped);

if (itemDropped != null) {

System.out.println("Not Null");

if (itemDropped.posY <= 0) {

System.out.println("In Void");

if (itemDropped.getEntityItem().getItem()

.equals(VoidMod.nullVoidAlloy)) {

System.out.println("Is Alloy");

w = itemDropped.worldObj;

x = itemDropped.posX;

z = itemDropped.posZ;

itemDropped.setDead();

itemDropped = null;

w.spawnEntityInWorld(new EntityItem(w, x, 200D, z,

new ItemStack(VoidMod.corruptAlloy)));

}

}

}

 

// WorldProviderNullVoid.getProviderForDimension(VoidMod.NullVoidDimID).setWorldTime(13000);

}

 

 

I am also having trouble with checking if the player has fallen into the void, it is the same code(In method 2) It is giving me the achievement but not teleporting me.

Link to comment
Share on other sites

  if (e.entityItem.dimension == VoidMod.NullVoidDimID)

 

Why are you checking the dimension? The item you need would be in the world where it created...

and you have to edit the teleporting code if you want to teleport the player.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

First how are you getting sent to your dimension.

Second

 p = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(pls);

should be

         p = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(pls[i]);

.

Third

 if (itemDropped.getEntityItem().getItem().equals(VoidMod.nullVoidAlloy))

should be

 if (itemDropped.getEntityItem().getItem() instanceof ItemNullVoidAlloy))

Link to comment
Share on other sites

I do not know why in the code I posted it says str, in my actual code it says str. Also, I have found that equals works in another case. My problem is that it is not recognizing it is in the void. Also I have a block that teleports you into my dimension, but my code is not able to recognize any item past y level 0, which is what I want to do.

Code:

TickListner:

 

 

package aj.Java.Nullvoid.Listners;

 

import java.awt.Color;

import java.util.List;

import java.util.Random;

 

import aj.Java.Nullvoid.VoidMod;

import baubles.api.BaublesApi;

import net.minecraft.client.Minecraft;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.entity.player.EntityPlayerMP;

import net.minecraft.item.ItemStack;

import net.minecraft.potion.Potion;

import net.minecraft.potion.PotionEffect;

import net.minecraft.server.MinecraftServer;

import net.minecraft.world.World;

import net.minecraftforge.client.event.RenderGameOverlayEvent;

import net.minecraftforge.client.event.TextureStitchEvent;

import net.minecraftforge.event.entity.item.ItemTossEvent;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

import cpw.mods.fml.common.gameevent.TickEvent;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class TickListner {

private World world;

@SubscribeEvent

public void onTick(TickEvent.ServerTickEvent event) {

// System.out.println("OnTick");

String[] pls = MinecraftServer.getServer().getConfigurationManager()

.getAllUsernames();

EntityPlayerMP p;

for (int i = 0; i < pls.length; i++) {

p = MinecraftServer.getServer().getConfigurationManager()

.getPlayerForUsername(pls);

if (p != null) {

// System.out.println("Got a ticked player");

if (p.posY <= 0) {

// System.out.println("In the void!");

if (p.dimension == VoidMod.NullVoidDimID) {

p.setLocationAndAngles(p.posX, 256, p.posZ,

p.cameraYaw, p.cameraPitch);

}

p.addStat(VoidMod.fallVoid, 1);

}

if (p.dimension == VoidMod.NullVoidDimID) {

if(p.inventory.getCurrentItem() == null){

p.clearActivePotions();

}

else{

if(!p.inventory.getCurrentItem().getItem().equals(VoidMod.baneOfDark)){

p.clearActivePotions();

}

else{

p.addPotionEffect(new PotionEffect(Potion.nightVision.id, 140, 10));

}

}

}

}

}

if(world != null){

@SuppressWarnings("rawtypes")

List l = world.loadedEntityList;

for(int i = 0; i < l.size(); i++){

if(l.get(i) != null){

if(l.get(i) instanceof EntityItem){

System.out.println("Not Null");

EntityItem item = (EntityItem)l.get(i);

if (item.posY <= 0) {

System.out.println("In Void");

if (item.getEntityItem().getItem()

.equals(VoidMod.nullVoidAlloy)) {

System.out.println("Is Alloy");

world.spawnEntityInWorld(new EntityItem(world, item.posX, 200D, item.posZ,

new ItemStack(VoidMod.corruptAlloy)));

}

}

}

}

}

}

 

// WorldProviderNullVoid.getProviderForDimension(VoidMod.NullVoidDimID).setWorldTime(13000);

}

 

@SubscribeEvent

@SideOnly(Side.CLIENT)

public void clientTick(TickEvent.ClientTickEvent event) {

if (Minecraft.getMinecraft().thePlayer != null) {

if (Minecraft.getMinecraft().thePlayer.dimension == VoidMod.NullVoidDimID) {

if(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem() != null){

if(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem().equals(VoidMod.baneOfDark)){

Minecraft.getMinecraft().gameSettings.gammaSetting = 1F;

}

else{

Minecraft.getMinecraft().gameSettings.gammaSetting = -1F;

}

}

else{

Minecraft.getMinecraft().gameSettings.gammaSetting = -1F;

}

} else {

if (Minecraft.getMinecraft().gameSettings.gammaSetting == -1F) {

Minecraft.getMinecraft().gameSettings.gammaSetting = Minecraft

.getMinecraft().thePlayer.getEntityData().getFloat(

"NullGamma");

}

}

}

}

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void texturePreStitch(TextureStitchEvent.Pre event) {

if (event.map.getTextureType() == 0) {

event.map.setTextureEntry("nullvoid:nullOre", VoidMod.texNullOre);

}

}

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void renderGlitch(RenderGameOverlayEvent event) {

if (VoidMod.glitchAmulet != null

&& Minecraft.getMinecraft().thePlayer != null) {

if (BaublesApi.getBaubles(Minecraft.getMinecraft().thePlayer)

.getStackInSlot(0) != null) {

if (!BaublesApi.getBaubles(Minecraft.getMinecraft().thePlayer)

.getStackInSlot(0)

.isItemEqual(new ItemStack(VoidMod.glitchAmulet))) {

glitch();

}

} else {

glitch();

}

}

}

 

@SubscribeEvent

public void crafted(ItemCraftedEvent event) {

if (event.crafting.getItem().equals(VoidMod.nullGoggles)) {

event.player.addStat(VoidMod.craftGoggle, 1);

}

}

 

@SubscribeEvent

public void itemDrop(ItemTossEvent e) {

System.out.println("Item Dropped");

if (e.entityItem.dimension == VoidMod.NullVoidDimID) {

System.out.println("In Void");

this.world = e.entityItem.worldObj;

}

}

 

private String getLetter() {

switch (new Random().nextInt(26)) {

case 0:

return "A";

case 1:

return "B";

case 2:

return "C";

case 3:

return "D";

case 4:

return "E";

case 5:

return "F";

case 6:

return "G";

case 7:

return "H";

case 8:

return "I";

case 9:

return "J";

case 10:

return "K";

case 11:

return "L";

case 12:

return "M";

case 13:

return "N";

case 14:

return "O";

case 15:

return "P";

case 16:

return "Q";

case 17:

return "R";

case 18:

return "S";

case 19:

return "T";

case 20:

return "U";

case 21:

return "V";

case 22:

return "W";

case 23:

return "X";

case 24:

return "Y";

case 25:

return "Z";

}

return null;

}

 

private void glitch() {

if (Minecraft.getMinecraft().thePlayer.dimension == VoidMod.NullVoidDimID) {

if (Minecraft.getMinecraft().thePlayer.posX < 10

&& Minecraft.getMinecraft().thePlayer.posX > -10

&& Minecraft.getMinecraft().thePlayer.posZ < 10

&& Minecraft.getMinecraft().thePlayer.posZ > -10) {

for (int i = 0; i < 10000; i++) {

Minecraft.getMinecraft().fontRenderer

.drawString(getLetter(),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(),

new Random().nextFloat()).getRGB());

}

} else if (Minecraft.getMinecraft().thePlayer.posX < 50

&& Minecraft.getMinecraft().thePlayer.posX > -50

&& Minecraft.getMinecraft().thePlayer.posZ < 50

&& Minecraft.getMinecraft().thePlayer.posZ > -50) {

for (int i = 0; i < 1000; i++) {

Minecraft.getMinecraft().fontRenderer

.drawString(getLetter(),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(),

new Random().nextFloat()).getRGB());

}

} else if (Minecraft.getMinecraft().thePlayer.posX < 100

&& Minecraft.getMinecraft().thePlayer.posX > -100

&& Minecraft.getMinecraft().thePlayer.posZ < 100

&& Minecraft.getMinecraft().thePlayer.posZ > -100) {

for (int i = 0; i < 100; i++) {

Minecraft.getMinecraft().fontRenderer

.drawString(getLetter(),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(),

new Random().nextFloat()).getRGB());

}

} else {

Minecraft.getMinecraft().fontRenderer

.drawString(

getLetter(),

new Random().nextInt(Minecraft.getMinecraft().displayWidth),

new Random().nextInt(Minecraft.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(), new Random()

.nextFloat()).getRGB());

}

}

}

}

 

 

Link to comment
Share on other sites

The tick listener is registered in both event bus things, and I am trying to teleport the item to x 256 in the dimension if they are in the dimension and under y 0. I have a separate method for getting in the dimension. I think I have a problem with getting the world, because there are no entries in world.loadedEntityList and the player one is detecting properly.

Link to comment
Share on other sites

Ok then. I just solved it by looping through all the worlds in MinecraftServer.getServer().worldServers and using those.

TickListner:

 

 

package aj.Java.Nullvoid.Listners;

 

import java.awt.Color;

import java.util.List;

import java.util.Random;

 

import aj.Java.Nullvoid.VoidMod;

import baubles.api.BaublesApi;

import net.minecraft.client.Minecraft;

import net.minecraft.entity.item.EntityItem;

import net.minecraft.entity.player.EntityPlayerMP;

import net.minecraft.item.ItemStack;

import net.minecraft.server.MinecraftServer;

import net.minecraft.world.World;

import net.minecraftforge.client.event.RenderGameOverlayEvent;

import net.minecraftforge.client.event.TextureStitchEvent;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

import cpw.mods.fml.common.gameevent.TickEvent;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class TickListner {

@SubscribeEvent

public void onTick(TickEvent.ServerTickEvent event) {

// System.out.println("OnTick");

String[] pls = MinecraftServer.getServer().getConfigurationManager()

.getAllUsernames();

EntityPlayerMP p;

for (int i = 0; i < pls.length; i++) {

p = MinecraftServer.getServer().getConfigurationManager()

.getPlayerForUsername(pls);

if (p != null) {

// System.out.println("Got a ticked player");

// System.out.println(p.posY);

if (p.posY < 0.01D) {

System.out.println("In the void!");

if (p.dimension == VoidMod.NullVoidDimID) {

p.setLocationAndAngles(p.posX, 256, p.posZ,

p.cameraYaw, p.cameraPitch);

}

p.addStat(VoidMod.fallVoid, 1);

}

if (p.dimension == VoidMod.NullVoidDimID) {

if (p.inventory.getCurrentItem() == null) {

p.clearActivePotions();

}

}

}

}

World world;

for (int ii = 0; ii < MinecraftServer.getServer().worldServers.length; ii++) {

world = MinecraftServer.getServer().worldServers[ii];

if (world != null) {

@SuppressWarnings("rawtypes")

List l = world.loadedEntityList;

for (int i = 0; i < l.size(); i++) {

if (l.get(i) != null) {

if (l.get(i) instanceof EntityItem) {

System.out.println("Not Null");

EntityItem item = (EntityItem) l.get(i);

if (item.posY < 1D) {

System.out.println("In Void");

if (item.getEntityItem().getItem()

.equals(VoidMod.nullVoidAlloy)) {

System.out.println("Is Alloy");

world.spawnEntityInWorld(new EntityItem(

world, item.posX, 200D, item.posZ,

new ItemStack(VoidMod.corruptAlloy, 1)));

}

}

}

}

}

}

}

 

// WorldProviderNullVoid.getProviderForDimension(VoidMod.NullVoidDimID).setWorldTime(13000);

}

 

@SubscribeEvent

@SideOnly(Side.CLIENT)

public void clientTick(TickEvent.ClientTickEvent event) {

if (Minecraft.getMinecraft().thePlayer != null) {

if (Minecraft.getMinecraft().thePlayer.dimension == VoidMod.NullVoidDimID) {

if (Minecraft.getMinecraft().thePlayer.inventory

.getCurrentItem() != null) {

if (Minecraft.getMinecraft().thePlayer.inventory

.getCurrentItem().getItem()

.equals(VoidMod.baneOfDark)) {

Minecraft.getMinecraft().gameSettings.gammaSetting = 1F;

} else {

Minecraft.getMinecraft().gameSettings.gammaSetting = -1F;

}

} else {

Minecraft.getMinecraft().gameSettings.gammaSetting = -1F;

}

} else {

if (Minecraft.getMinecraft().gameSettings.gammaSetting == -1F) {

Minecraft.getMinecraft().gameSettings.gammaSetting = Minecraft

.getMinecraft().thePlayer.getEntityData().getFloat(

"NullGamma");

}

}

}

}

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void texturePreStitch(TextureStitchEvent.Pre event) {

if (event.map.getTextureType() == 0) {

event.map.setTextureEntry("nullvoid:nullOre", VoidMod.texNullOre);

}

}

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void renderGlitch(RenderGameOverlayEvent event) {

if (VoidMod.glitchAmulet != null

&& Minecraft.getMinecraft().thePlayer != null) {

if (BaublesApi.getBaubles(Minecraft.getMinecraft().thePlayer)

.getStackInSlot(0) != null) {

if (!BaublesApi.getBaubles(Minecraft.getMinecraft().thePlayer)

.getStackInSlot(0)

.isItemEqual(new ItemStack(VoidMod.glitchAmulet))) {

glitch();

}

} else {

glitch();

}

}

}

 

@SubscribeEvent

public void crafted(ItemCraftedEvent event) {

if (event.crafting.getItem().equals(VoidMod.nullGoggles)) {

event.player.addStat(VoidMod.craftGoggle, 1);

}

}

 

private String getLetter() {

switch (new Random().nextInt(26)) {

case 0:

return "A";

case 1:

return "B";

case 2:

return "C";

case 3:

return "D";

case 4:

return "E";

case 5:

return "F";

case 6:

return "G";

case 7:

return "H";

case 8:

return "I";

case 9:

return "J";

case 10:

return "K";

case 11:

return "L";

case 12:

return "M";

case 13:

return "N";

case 14:

return "O";

case 15:

return "P";

case 16:

return "Q";

case 17:

return "R";

case 18:

return "S";

case 19:

return "T";

case 20:

return "U";

case 21:

return "V";

case 22:

return "W";

case 23:

return "X";

case 24:

return "Y";

case 25:

return "Z";

}

return null;

}

 

private void glitch() {

if (Minecraft.getMinecraft().thePlayer.dimension == VoidMod.NullVoidDimID) {

if (Minecraft.getMinecraft().thePlayer.posX < 10

&& Minecraft.getMinecraft().thePlayer.posX > -10

&& Minecraft.getMinecraft().thePlayer.posZ < 10

&& Minecraft.getMinecraft().thePlayer.posZ > -10) {

for (int i = 0; i < 10000; i++) {

Minecraft.getMinecraft().fontRenderer

.drawString(getLetter(),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(),

new Random().nextFloat()).getRGB());

}

} else if (Minecraft.getMinecraft().thePlayer.posX < 50

&& Minecraft.getMinecraft().thePlayer.posX > -50

&& Minecraft.getMinecraft().thePlayer.posZ < 50

&& Minecraft.getMinecraft().thePlayer.posZ > -50) {

for (int i = 0; i < 1000; i++) {

Minecraft.getMinecraft().fontRenderer

.drawString(getLetter(),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(),

new Random().nextFloat()).getRGB());

}

} else if (Minecraft.getMinecraft().thePlayer.posX < 100

&& Minecraft.getMinecraft().thePlayer.posX > -100

&& Minecraft.getMinecraft().thePlayer.posZ < 100

&& Minecraft.getMinecraft().thePlayer.posZ > -100) {

for (int i = 0; i < 100; i++) {

Minecraft.getMinecraft().fontRenderer

.drawString(getLetter(),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Random().nextInt(Minecraft

.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(),

new Random().nextFloat()).getRGB());

}

} else {

Minecraft.getMinecraft().fontRenderer

.drawString(

getLetter(),

new Random().nextInt(Minecraft.getMinecraft().displayWidth),

new Random().nextInt(Minecraft.getMinecraft().displayWidth),

new Color(new Random().nextFloat(),

new Random().nextFloat(), new Random()

.nextFloat()).getRGB());

}

}

}

}

 

 

Link to comment
Share on other sites

Ok, I edited to your comments, but I need to set the player's gamma to one previously set, and I want to to retain across minecraft closings. How would I do that? I think packets but I do not know how to use them at all. Thanks for helping me fix my code :).

Revised TickListner:

 

 

package aj.Java.Nullvoid.Listners;

 

import java.awt.Color;

import java.util.Random;

 

import aj.Java.Nullvoid.VoidMod;

import baubles.api.BaublesApi;

import net.minecraft.client.Minecraft;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.ItemStack;

import net.minecraftforge.client.event.RenderGameOverlayEvent;

import net.minecraftforge.client.event.TextureStitchEvent;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

import cpw.mods.fml.common.gameevent.TickEvent;

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class TickListner {

private Minecraft m = Minecraft.getMinecraft();

private Random r = new Random();

@SubscribeEvent

public void playerTick(PlayerTickEvent event){

EntityPlayer p = event.player;

if (p != null) {

// System.out.println("Got a ticked player");

// System.out.println(p.posY);

if (p.posY < 0.01D) {

System.out.println("In the void!");

if (p.dimension == VoidMod.NullVoidDimID) {

p.setLocationAndAngles(p.posX, 256, p.posZ,

p.cameraYaw, p.cameraPitch);

}

p.addStat(VoidMod.fallVoid, 1);

}

if (p.dimension == VoidMod.NullVoidDimID) {

if (p.inventory.getCurrentItem() == null) {

p.clearActivePotions();

}

}

}

}

 

@SubscribeEvent

@SideOnly(Side.CLIENT)

public void clientTick(TickEvent.ClientTickEvent event) {

if (m.thePlayer != null) {

if (m.thePlayer.dimension == VoidMod.NullVoidDimID) {

if (m.thePlayer.inventory

.getCurrentItem() != null) {

if (m.thePlayer.inventory

.getCurrentItem().getItem()

.equals(VoidMod.baneOfDark)) {

m.gameSettings.gammaSetting = 1F;

} else {

m.gameSettings.gammaSetting = -1F;

}

} else {

m.gameSettings.gammaSetting = -1F;

}

} else {

if (m.gameSettings.gammaSetting == -1F) {

m.gameSettings.gammaSetting = Minecraft

.getMinecraft().thePlayer.getEntityData().getFloat(

"NullGamma");

}

}

}

}

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void texturePreStitch(TextureStitchEvent.Pre event) {

if (event.map.getTextureType() == 0) {

event.map.setTextureEntry("nullvoid:nullOre", VoidMod.texNullOre);

}

}

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void renderGlitch(RenderGameOverlayEvent event) {

if (VoidMod.glitchAmulet != null

&& m.thePlayer != null) {

if (BaublesApi.getBaubles(m.thePlayer)

.getStackInSlot(0) != null) {

if (!BaublesApi.getBaubles(m.thePlayer)

.getStackInSlot(0)

.isItemEqual(new ItemStack(VoidMod.glitchAmulet))) {

glitch();

}

} else {

glitch();

}

}

}

 

@SubscribeEvent

public void crafted(ItemCraftedEvent event) {

if (event.crafting.getItem().equals(VoidMod.nullGoggles)) {

event.player.addStat(VoidMod.craftGoggle, 1);

}

}

 

private String getLetter() {

return String.valueOf(Character.toChars(r.nextInt(93) + 33));

}

 

private void glitch() {

if (m.thePlayer.dimension == VoidMod.NullVoidDimID) {

if (m.thePlayer.posX < 10

&& m.thePlayer.posX > -10

&& m.thePlayer.posZ < 10

&& m.thePlayer.posZ > -10) {

for (int i = 0; i < 10000; i++) {

m.fontRenderer

.drawString(getLetter(),

r.nextInt(m.displayWidth),

r.nextInt(m.displayWidth),

new Color(r.nextFloat(),

r.nextFloat(),

r.nextFloat()).getRGB());

}

} else if (m.thePlayer.posX < 50

&& m.thePlayer.posX > -50

&& m.thePlayer.posZ < 50

&& m.thePlayer.posZ > -50) {

for (int i = 0; i < 1000; i++) {

m.fontRenderer

.drawString(getLetter(),

r.nextInt(m.displayWidth),

r.nextInt(m.displayWidth),

new Color(r.nextFloat(),

r.nextFloat(),

r.nextFloat()).getRGB());

}

} else if (m.thePlayer.posX < 100

&& m.thePlayer.posX > -100

&& m.thePlayer.posZ < 100

&& m.thePlayer.posZ > -100) {

for (int i = 0; i < 100; i++) {

m.fontRenderer

.drawString(getLetter(),

r.nextInt(m.displayWidth),

r.nextInt(m.displayWidth),

new Color(r.nextFloat(),

r.nextFloat(),

r.nextFloat()).getRGB());

}

} else {

m.fontRenderer

.drawString(

getLetter(),

r.nextInt(m.displayWidth),

r.nextInt(m.displayHeight),

new Color(r.nextFloat(),

r.nextFloat(), r

.nextFloat()).getRGB());

}

}

}

}

 

 

Link to comment
Share on other sites

Ok, Thanks.

I am trying to change the player's gamma to -1F when they enter a dimension and revert it to their previous gamma when they exit. I already have it saving their gamma somewhere else, but I also need to revert it and make sure it is enforced if something does not work.

Link to comment
Share on other sites

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

    • rftoolsbuilder:shielding_cutout (from lostcities-1.19-6.0.24.jar),rftoolsstorage:crafting_manager (from lostcities-1.19-6.0.24.jar),deepresonance:dense_glass (from lostcities-1.19-6.0.24.jar),restrictions:oneway (from lostcities-1.19-6.0.24.jar),restrictions:oneway_wall (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_complete (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_pane_complete (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_mossy (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_pane_mossy (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_broken (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_pane_broken (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_broken_mossy (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_pane_broken_mossy (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_vines (from lostcities-1.19-6.0.24.jar),lostruins:glassgray3x2_pane_vines (from lostcities-1.19-6.0.24.jar)[13:50:17] [main/INFO] [minecraft/RecipeManager]: Skipping loading recipe supplementaries:inspirations/blackboard_clear as it's serializer returned null[13:50:17] [main/INFO] [minecraft/RecipeManager]: Skipping loading recipe supplementaries:inspirations/flag_dye as it's serializer returned null[13:50:17] [main/INFO] [minecraft/RecipeManager]: Skipping loading recipe supplementaries:inspirations/flag_clear as it's serializer returned null[13:50:17] [main/INFO] [minecraft/RecipeManager]: Loaded 36 recipes[13:50:17] [main/INFO] [Spartan Weaponry/]: Adding Diamond Weapons to the End City Treasure Loot Table![13:50:17] [main/INFO] [Spartan Weaponry/]: Adding Longbow and Heavy Crossbow related loot to the Village Fletcher Loot Table![13:50:18] [main/INFO] [Spartan Weaponry/]: Adding Iron Weapons to the Village Weaponsmith Loot Table![13:50:18] [main/ERROR] [minecraft/ServerFunctionLibrary]: Failed to load function watching:checkjava.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Unknown or incomplete command, see below for error at position 0: <--[HERE]at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {re:mixin}at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {re:mixin}at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?] {}at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?] {}at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:computing_frames}at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:computing_frames}at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}Caused by: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Unknown or incomplete command, see below for error at position 0: <--[HERE]at net.minecraft.commands.CommandFunction.m_77984_(CommandFunction.java:63) ~[server-1.19.2-20220805.130853-srg.jar%23299!/:?] {re:classloading}at net.minecraft.server.ServerFunctionLibrary.m_214320_(ServerFunctionLibrary.java:85) ~[server-1.19.2-20220805.130853-srg.jar%23299!/:?] {re:classloading}at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] {}... 6 more[13:50:18] [main/INFO] [quark/]: [Automatic Recipe Unlock] Removed 3712 recipe advancements[13:50:18] [main/INFO] [minecraft/AdvancementList]: Loaded 684 advancements[13:50:18] [main/INFO] [at.dy.se.ItemLightLevels/]: Clearing item tag to light level mapping cache[13:50:18] [main/INFO] [sl.ma.fl.tr.FluidContainerTransferManager/]: Loaded 0 dynamic modifiers in 0.246528 ms[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:husbandry/wax_on with 2 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:adventure/kill_a_mob with 3 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:husbandry/bred_all_animals with 3 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:adventure/kill_all_mobs with 3 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:husbandry/make_a_sign_glow with 1 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:husbandry/balanced_diet with 3 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:husbandry/plant_seed with 1 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:nether/all_effects with 2 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:husbandry/wax_off with 2 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:adventure/adventuring_time with 1 patches[13:50:18] [main/INFO] [quark/]: Modified advancement minecraft:nether/all_potions with 1 patches[13:50:18] [main/INFO] [supplementaries/]: Loaded 8 flute songs[13:50:20] [main/INFO] [Spartan Weaponry/]: Finished initialising Weapon Traits & Attributes! Took 11.202781ms[13:50:20] [main/INFO] [supplementaries/]: Finished additional setup in 103 ms[13:50:20] [main/WARN] [minecraft/DedicatedServerProperties]: Failed to parse level-type biomesoplenty, defaulting to minecraft:normal[13:50:20] [Server thread/INFO] [minecraft/DedicatedServer]: Starting minecraft server version 1.19.2[13:50:20] [Server thread/INFO] [minecraft/DedicatedServer]: Loading properties[13:50:20] [Server thread/INFO] [minecraft/DedicatedServer]: Default game type: SURVIVAL[13:50:20] [Server thread/INFO] [minecraft/MinecraftServer]: Generating keypair[13:50:21] [Server thread/INFO] [minecraft/DedicatedServer]: Starting Minecraft server on :::25983[13:50:21] [Server thread/INFO] [minecraft/ServerConnectionListener]: Using epoll channel type[13:50:21] [Thread-0/INFO] [de.ca.ca.CaveDweller/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.ca.CaveDweller/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.st.SteveDweller/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.st.SteveDweller/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.sk.Skinstalker/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.sk.SkinwalkerOverhaul/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.sk.SkinwalkerOverhaul/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.go.Goatman/]: Server configuration has been reloaded[13:50:21] [Thread-0/INFO] [de.ca.go.Goatman/]: Server configuration has been reloaded[13:50:21] [Server thread/INFO] [at.dy.se.mo.PlayerSelfLightSource/]: item config parser identified itemstack 1 torch[13:50:21] [Server thread/INFO] [at.dy.se.mo.PlayerSelfLightSource/]: item config parser identified itemstack 1 glowstone[13:50:21] [Server thread/INFO] [at.dy.se.mo.PlayerSelfLightSource/]: item config parser finished, item count: 2[13:50:21] [Server thread/INFO] [at.dy.se.mo.PlayerSelfLightSource/]: item config parser identified itemstack 1 torch[13:50:21] [Server thread/INFO] [at.dy.se.mo.PlayerSelfLightSource/]: item config parser finished, item count: 1[13:50:21] [Server thread/INFO] [at.dy.se.mo.DroppedItemsLightSource/]: item config parser identified itemstack 1 torch[13:50:21] [Server thread/INFO] [at.dy.se.mo.DroppedItemsLightSource/]: item config parser identified itemstack 1 glowstone[13:50:21] [Server thread/INFO] [at.dy.se.mo.DroppedItemsLightSource/]: item config parser finished, item count: 2[13:50:21] [Server thread/INFO] [at.dy.se.mo.DroppedItemsLightSource/]: item config parser identified itemstack 1 torch[13:50:21] [Server thread/INFO] [at.dy.se.mo.DroppedItemsLightSource/]: item config parser finished, item count: 1[13:50:21] [Server thread/INFO] [Framework/]: Loading server configs...[13:50:22] [Server thread/INFO] [terrablender/]: Initialized TerraBlender biomes for level stem minecraft:overworld[13:50:22] [Server thread/INFO] [terrablender/]: Initialized TerraBlender biomes for level stem minecraft:the_nether[13:50:22] [Server thread/INFO] [minecraft/DedicatedServer]: Preparing level "world"[13:50:35] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for dimension minecraft:overworld[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:40] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:41] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:41] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%[13:50:42] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 17%[13:50:42] [Server thread/INFO] [minecraft/LoggerChunkProgressListener]: Time elapsed: 7618 ms[13:50:42] [Server thread/INFO] [minecraft/DedicatedServer]: Done (21.501s)! For help, type "help"[13:50:42] [Server thread/INFO] [minecraft/DedicatedServer]: Starting GS4 status listener[13:50:42] [Server thread/INFO] [minecraft/GenericThread]: Thread Query Listener started[13:50:42] [Query Listener #1/INFO] [minecraft/QueryThreadGs4]: Query running on :::25983[13:50:42] [Server thread/INFO] [ne.mi.se.pe.PermissionAPI/]: Successfully initialized permission handler forge:default_handler
    • Visit WEB:  https://www.strongspellcaster.us.com New York City, NY's love spells +27732318372 *To Get Back Ex Lover* Black magic cleansing.  
    • +27732318372 MOST GIFTED VOODOO MAGIC LOST LOVE SPELLS TO BRING BACK AN EX LOVER << USA CANADA USA .. >> visit website (https://www.strongspellcaster.us.com) s.
    • The conflict arises from discrepancies between different versions of GSON. My suggestion would be to remove your dependency on GSON 2.8.6 and opt for a different approach. Instead of using the static method JsonParser.parseString, you can create a JsonParser object and then use the parse method.   JsonParser jsonParser = new JsonParser(); jsonParser.parse(jsonString)  
  • Topics

×
×
  • Create New...

Important Information

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