nosingleplayer 1.1.1: fond custom via blit + log debug widgets
This commit is contained in:
+163
@@ -0,0 +1,163 @@
|
||||
package net.paladrill.paladrillmod.procedure;
|
||||
|
||||
import net.paladrill.paladrillmod.item.ItemOrangeBlueSeeds;
|
||||
import net.paladrill.paladrillmod.item.ItemOkamiSeeds;
|
||||
import net.paladrill.paladrillmod.item.ItemKiwanoSeeds;
|
||||
import net.paladrill.paladrillmod.item.ItemFikutsiSeeds;
|
||||
import net.paladrill.paladrillmod.ElementsPaladrillmodMod;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ElementsPaladrillmodMod.ModElement.Tag
|
||||
public class ProcedureHaveKiwanoSeeds extends ElementsPaladrillmodMod.ModElement {
|
||||
public ProcedureHaveKiwanoSeeds(ElementsPaladrillmodMod instance) {
|
||||
super(instance, 195);
|
||||
}
|
||||
|
||||
public static void executeProcedure(Map<String, Object> dependencies) {
|
||||
if (dependencies.get("x") == null) {
|
||||
System.err.println("Failed to load dependency x for procedure HaveKiwanoSeeds!");
|
||||
return;
|
||||
}
|
||||
if (dependencies.get("y") == null) {
|
||||
System.err.println("Failed to load dependency y for procedure HaveKiwanoSeeds!");
|
||||
return;
|
||||
}
|
||||
if (dependencies.get("z") == null) {
|
||||
System.err.println("Failed to load dependency z for procedure HaveKiwanoSeeds!");
|
||||
return;
|
||||
}
|
||||
if (dependencies.get("world") == null) {
|
||||
System.err.println("Failed to load dependency world for procedure HaveKiwanoSeeds!");
|
||||
return;
|
||||
}
|
||||
int x = (int) dependencies.get("x");
|
||||
int y = (int) dependencies.get("y");
|
||||
int z = (int) dependencies.get("z");
|
||||
World world = (World) dependencies.get("world");
|
||||
if (((world.getBlockState(new BlockPos((int) x, (int) y, (int) z))).getBlock() == Blocks.TALLGRASS.getStateFromMeta(1).getBlock())) {
|
||||
if ((Math.random() < 0.004)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemOrangeBlueSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.005)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemKiwanoSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.02)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemFikutsiSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.01)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemOkamiSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (((world.getBlockState(new BlockPos((int) x, (int) y, (int) z))).getBlock() == Blocks.DOUBLE_PLANT.getStateFromMeta(2).getBlock())) {
|
||||
if ((Math.random() < 0.005)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemKiwanoSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.004)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemOrangeBlueSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.02)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemFikutsiSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.01)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemOkamiSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (((world.getBlockState(new BlockPos((int) x, (int) y, (int) z))).getBlock() == Blocks.AIR.getDefaultState().getBlock())) {
|
||||
if ((Math.random() < 0.005)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemOrangeBlueSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.009)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemKiwanoSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.02)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemFikutsiSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
if ((Math.random() < 0.01)) {
|
||||
if (!world.isRemote) {
|
||||
EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(ItemOkamiSeeds.block, (int) (1)));
|
||||
entityToSpawn.setPickupDelay(10);
|
||||
world.spawnEntity(entityToSpawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||
Entity entity = event.getPlayer();
|
||||
java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
|
||||
dependencies.put("xpAmount", event.getExpToDrop());
|
||||
dependencies.put("x", (int) event.getPos().getX());
|
||||
dependencies.put("y", (int) event.getPos().getY());
|
||||
dependencies.put("z", (int) event.getPos().getZ());
|
||||
dependencies.put("px", (int) entity.posX);
|
||||
dependencies.put("py", (int) entity.posY);
|
||||
dependencies.put("pz", (int) entity.posZ);
|
||||
dependencies.put("world", event.getWorld());
|
||||
dependencies.put("entity", entity);
|
||||
dependencies.put("event", event);
|
||||
this.executeProcedure(dependencies);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user