mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
Add files from mc-dev for diff visibility.
This commit is contained in:
parent
d4fe10394a
commit
b6831792ec
28
src/main/java/net/minecraft/server/BiomeTheEndDecorator.java
Normal file
28
src/main/java/net/minecraft/server/BiomeTheEndDecorator.java
Normal file
@ -0,0 +1,28 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
public class BiomeTheEndDecorator extends BiomeDecorator {
|
||||
|
||||
protected WorldGenerator J;
|
||||
|
||||
public BiomeTheEndDecorator() {
|
||||
this.J = new WorldGenEnder(Blocks.WHITESTONE);
|
||||
}
|
||||
|
||||
protected void a(BiomeBase biomebase) {
|
||||
this.a();
|
||||
if (this.b.nextInt(5) == 0) {
|
||||
int i = this.c + this.b.nextInt(16) + 8;
|
||||
int j = this.d + this.b.nextInt(16) + 8;
|
||||
int k = this.a.i(i, j);
|
||||
|
||||
this.J.a(this.a, this.b, i, k, j);
|
||||
}
|
||||
|
||||
if (this.c == 0 && this.d == 0) {
|
||||
EntityEnderDragon entityenderdragon = new EntityEnderDragon(this.a);
|
||||
|
||||
entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.b.nextFloat() * 360.0F, 0.0F);
|
||||
this.a.addEntity(entityenderdragon);
|
||||
}
|
||||
}
|
||||
}
|
119
src/main/java/net/minecraft/server/BlockMonsterEggs.java
Normal file
119
src/main/java/net/minecraft/server/BlockMonsterEggs.java
Normal file
@ -0,0 +1,119 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.util.org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
|
||||
public class BlockMonsterEggs extends Block {
|
||||
|
||||
public static final String[] a = new String[] { "stone", "cobble", "brick", "mossybrick", "crackedbrick", "chiseledbrick"};
|
||||
|
||||
public BlockMonsterEggs() {
|
||||
super(Material.CLAY);
|
||||
this.c(0.0F);
|
||||
this.a(CreativeModeTab.c);
|
||||
}
|
||||
|
||||
public void postBreak(World world, int i, int j, int k, int l) {
|
||||
if (!world.isStatic) {
|
||||
EntitySilverfish entitysilverfish = new EntitySilverfish(world);
|
||||
|
||||
entitysilverfish.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
world.addEntity(entitysilverfish);
|
||||
entitysilverfish.s();
|
||||
}
|
||||
|
||||
super.postBreak(world, i, j, k, l);
|
||||
}
|
||||
|
||||
public int a(Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean a(Block block) {
|
||||
return block == Blocks.STONE || block == Blocks.COBBLESTONE || block == Blocks.SMOOTH_BRICK;
|
||||
}
|
||||
|
||||
public static int a(Block block, int i) {
|
||||
if (i == 0) {
|
||||
if (block == Blocks.COBBLESTONE) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (block == Blocks.SMOOTH_BRICK) {
|
||||
return 2;
|
||||
}
|
||||
} else if (block == Blocks.SMOOTH_BRICK) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
return 3;
|
||||
|
||||
case 2:
|
||||
return 4;
|
||||
|
||||
case 3:
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static ImmutablePair b(int i) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
return new ImmutablePair(Blocks.COBBLESTONE, Integer.valueOf(0));
|
||||
|
||||
case 2:
|
||||
return new ImmutablePair(Blocks.SMOOTH_BRICK, Integer.valueOf(0));
|
||||
|
||||
case 3:
|
||||
return new ImmutablePair(Blocks.SMOOTH_BRICK, Integer.valueOf(1));
|
||||
|
||||
case 4:
|
||||
return new ImmutablePair(Blocks.SMOOTH_BRICK, Integer.valueOf(2));
|
||||
|
||||
case 5:
|
||||
return new ImmutablePair(Blocks.SMOOTH_BRICK, Integer.valueOf(3));
|
||||
|
||||
default:
|
||||
return new ImmutablePair(Blocks.STONE, Integer.valueOf(0));
|
||||
}
|
||||
}
|
||||
|
||||
protected ItemStack j(int i) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
return new ItemStack(Blocks.COBBLESTONE);
|
||||
|
||||
case 2:
|
||||
return new ItemStack(Blocks.SMOOTH_BRICK);
|
||||
|
||||
case 3:
|
||||
return new ItemStack(Blocks.SMOOTH_BRICK, 1, 1);
|
||||
|
||||
case 4:
|
||||
return new ItemStack(Blocks.SMOOTH_BRICK, 1, 2);
|
||||
|
||||
case 5:
|
||||
return new ItemStack(Blocks.SMOOTH_BRICK, 1, 3);
|
||||
|
||||
default:
|
||||
return new ItemStack(Blocks.STONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
|
||||
if (!world.isStatic) {
|
||||
EntitySilverfish entitysilverfish = new EntitySilverfish(world);
|
||||
|
||||
entitysilverfish.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
world.addEntity(entitysilverfish);
|
||||
entitysilverfish.s();
|
||||
}
|
||||
}
|
||||
|
||||
public int getDropData(World world, int i, int j, int k) {
|
||||
return world.getData(i, j, k);
|
||||
}
|
||||
}
|
189
src/main/java/net/minecraft/server/WorldGenVillagePiece.java
Normal file
189
src/main/java/net/minecraft/server/WorldGenVillagePiece.java
Normal file
@ -0,0 +1,189 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
abstract class WorldGenVillagePiece extends StructurePiece {
|
||||
|
||||
protected int k = -1;
|
||||
private int a;
|
||||
private boolean b;
|
||||
|
||||
public WorldGenVillagePiece() {}
|
||||
|
||||
protected WorldGenVillagePiece(WorldGenVillageStartPiece worldgenvillagestartpiece, int i) {
|
||||
super(i);
|
||||
if (worldgenvillagestartpiece != null) {
|
||||
this.b = worldgenvillagestartpiece.b;
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setInt("HPos", this.k);
|
||||
nbttagcompound.setInt("VCount", this.a);
|
||||
nbttagcompound.setBoolean("Desert", this.b);
|
||||
}
|
||||
|
||||
protected void b(NBTTagCompound nbttagcompound) {
|
||||
this.k = nbttagcompound.getInt("HPos");
|
||||
this.a = nbttagcompound.getInt("VCount");
|
||||
this.b = nbttagcompound.getBoolean("Desert");
|
||||
}
|
||||
|
||||
protected StructurePiece a(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j) {
|
||||
switch (this.g) {
|
||||
case 0:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.a - 1, this.f.b + i, this.f.c + j, 1, this.d());
|
||||
|
||||
case 1:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.a + j, this.f.b + i, this.f.c - 1, 2, this.d());
|
||||
|
||||
case 2:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.a - 1, this.f.b + i, this.f.c + j, 1, this.d());
|
||||
|
||||
case 3:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.a + j, this.f.b + i, this.f.c - 1, 2, this.d());
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected StructurePiece b(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j) {
|
||||
switch (this.g) {
|
||||
case 0:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.d + 1, this.f.b + i, this.f.c + j, 3, this.d());
|
||||
|
||||
case 1:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.a + j, this.f.b + i, this.f.f + 1, 0, this.d());
|
||||
|
||||
case 2:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.d + 1, this.f.b + i, this.f.c + j, 3, this.d());
|
||||
|
||||
case 3:
|
||||
return WorldGenVillagePieces.a(worldgenvillagestartpiece, list, random, this.f.a + j, this.f.b + i, this.f.f + 1, 0, this.d());
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected int b(World world, StructureBoundingBox structureboundingbox) {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
for (int k = this.f.c; k <= this.f.f; ++k) {
|
||||
for (int l = this.f.a; l <= this.f.d; ++l) {
|
||||
if (structureboundingbox.b(l, 64, k)) {
|
||||
i += Math.max(world.i(l, k), world.worldProvider.getSeaLevel());
|
||||
++j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (j == 0) {
|
||||
return -1;
|
||||
} else {
|
||||
return i / j;
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean a(StructureBoundingBox structureboundingbox) {
|
||||
return structureboundingbox != null && structureboundingbox.b > 10;
|
||||
}
|
||||
|
||||
protected void a(World world, StructureBoundingBox structureboundingbox, int i, int j, int k, int l) {
|
||||
if (this.a < l) {
|
||||
for (int i1 = this.a; i1 < l; ++i1) {
|
||||
int j1 = this.a(i + i1, k);
|
||||
int k1 = this.a(j);
|
||||
int l1 = this.b(i + i1, k);
|
||||
|
||||
if (!structureboundingbox.b(j1, k1, l1)) {
|
||||
break;
|
||||
}
|
||||
|
||||
++this.a;
|
||||
EntityVillager entityvillager = new EntityVillager(world, this.b(i1));
|
||||
|
||||
entityvillager.setPositionRotation((double) j1 + 0.5D, (double) k1, (double) l1 + 0.5D, 0.0F, 0.0F);
|
||||
world.addEntity(entityvillager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected int b(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Block b(Block block, int i) {
|
||||
if (this.b) {
|
||||
if (block == Blocks.LOG || block == Blocks.LOG2) {
|
||||
return Blocks.SANDSTONE;
|
||||
}
|
||||
|
||||
if (block == Blocks.COBBLESTONE) {
|
||||
return Blocks.SANDSTONE;
|
||||
}
|
||||
|
||||
if (block == Blocks.WOOD) {
|
||||
return Blocks.SANDSTONE;
|
||||
}
|
||||
|
||||
if (block == Blocks.WOOD_STAIRS) {
|
||||
return Blocks.SANDSTONE_STAIRS;
|
||||
}
|
||||
|
||||
if (block == Blocks.COBBLESTONE_STAIRS) {
|
||||
return Blocks.SANDSTONE_STAIRS;
|
||||
}
|
||||
|
||||
if (block == Blocks.GRAVEL) {
|
||||
return Blocks.SANDSTONE;
|
||||
}
|
||||
}
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
protected int c(Block block, int i) {
|
||||
if (this.b) {
|
||||
if (block == Blocks.LOG || block == Blocks.LOG2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (block == Blocks.COBBLESTONE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (block == Blocks.WOOD) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected void a(World world, Block block, int i, int j, int k, int l, StructureBoundingBox structureboundingbox) {
|
||||
Block block1 = this.b(block, i);
|
||||
int i1 = this.c(block, i);
|
||||
|
||||
super.a(world, block1, i1, j, k, l, structureboundingbox);
|
||||
}
|
||||
|
||||
protected void a(World world, StructureBoundingBox structureboundingbox, int i, int j, int k, int l, int i1, int j1, Block block, Block block1, boolean flag) {
|
||||
Block block2 = this.b(block, 0);
|
||||
int k1 = this.c(block, 0);
|
||||
Block block3 = this.b(block1, 0);
|
||||
int l1 = this.c(block1, 0);
|
||||
|
||||
super.a(world, structureboundingbox, i, j, k, l, i1, j1, block2, k1, block3, l1, flag);
|
||||
}
|
||||
|
||||
protected void b(World world, Block block, int i, int j, int k, int l, StructureBoundingBox structureboundingbox) {
|
||||
Block block1 = this.b(block, i);
|
||||
int i1 = this.c(block, i);
|
||||
|
||||
super.b(world, block1, i1, j, k, l, structureboundingbox);
|
||||
}
|
||||
}
|
199
src/main/java/net/minecraft/server/WorldGenVillagePieces.java
Normal file
199
src/main/java/net/minecraft/server/WorldGenVillagePieces.java
Normal file
@ -0,0 +1,199 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class WorldGenVillagePieces {
|
||||
|
||||
public static void a() {
|
||||
WorldGenFactory.a(WorldGenVillageLibrary.class, "ViBH");
|
||||
WorldGenFactory.a(WorldGenVillageFarm2.class, "ViDF");
|
||||
WorldGenFactory.a(WorldGenVillageFarm.class, "ViF");
|
||||
WorldGenFactory.a(WorldGenVillageLight.class, "ViL");
|
||||
WorldGenFactory.a(WorldGenVillageButcher.class, "ViPH");
|
||||
WorldGenFactory.a(WorldGenVillageHouse.class, "ViSH");
|
||||
WorldGenFactory.a(WorldGenVillageHut.class, "ViSmH");
|
||||
WorldGenFactory.a(WorldGenVillageTemple.class, "ViST");
|
||||
WorldGenFactory.a(WorldGenVillageBlacksmith.class, "ViS");
|
||||
WorldGenFactory.a(WorldGenVillageStartPiece.class, "ViStart");
|
||||
WorldGenFactory.a(WorldGenVillageRoad.class, "ViSR");
|
||||
WorldGenFactory.a(WorldGenVillageHouse2.class, "ViTRH");
|
||||
WorldGenFactory.a(WorldGenVillageWell.class, "ViW");
|
||||
}
|
||||
|
||||
public static List a(Random random, int i) {
|
||||
ArrayList arraylist = new ArrayList();
|
||||
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageHouse.class, 4, MathHelper.nextInt(random, 2 + i, 4 + i * 2)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageTemple.class, 20, MathHelper.nextInt(random, 0 + i, 1 + i)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageLibrary.class, 20, MathHelper.nextInt(random, 0 + i, 2 + i)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageHut.class, 3, MathHelper.nextInt(random, 2 + i, 5 + i * 3)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageButcher.class, 15, MathHelper.nextInt(random, 0 + i, 2 + i)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageFarm2.class, 3, MathHelper.nextInt(random, 1 + i, 4 + i)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageFarm.class, 3, MathHelper.nextInt(random, 2 + i, 4 + i * 2)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageBlacksmith.class, 15, MathHelper.nextInt(random, 0, 1 + i)));
|
||||
arraylist.add(new WorldGenVillagePieceWeight(WorldGenVillageHouse2.class, 8, MathHelper.nextInt(random, 0 + i, 3 + i * 2)));
|
||||
Iterator iterator = arraylist.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
if (((WorldGenVillagePieceWeight) iterator.next()).d == 0) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
return arraylist;
|
||||
}
|
||||
|
||||
private static int a(List list) {
|
||||
boolean flag = false;
|
||||
int i = 0;
|
||||
|
||||
WorldGenVillagePieceWeight worldgenvillagepieceweight;
|
||||
|
||||
for (Iterator iterator = list.iterator(); iterator.hasNext(); i += worldgenvillagepieceweight.b) {
|
||||
worldgenvillagepieceweight = (WorldGenVillagePieceWeight) iterator.next();
|
||||
if (worldgenvillagepieceweight.d > 0 && worldgenvillagepieceweight.c < worldgenvillagepieceweight.d) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
return flag ? i : -1;
|
||||
}
|
||||
|
||||
private static WorldGenVillagePiece a(WorldGenVillageStartPiece worldgenvillagestartpiece, WorldGenVillagePieceWeight worldgenvillagepieceweight, List list, Random random, int i, int j, int k, int l, int i1) {
|
||||
Class oclass = worldgenvillagepieceweight.a;
|
||||
Object object = null;
|
||||
|
||||
if (oclass == WorldGenVillageHouse.class) {
|
||||
object = WorldGenVillageHouse.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageTemple.class) {
|
||||
object = WorldGenVillageTemple.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageLibrary.class) {
|
||||
object = WorldGenVillageLibrary.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageHut.class) {
|
||||
object = WorldGenVillageHut.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageButcher.class) {
|
||||
object = WorldGenVillageButcher.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageFarm2.class) {
|
||||
object = WorldGenVillageFarm2.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageFarm.class) {
|
||||
object = WorldGenVillageFarm.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageBlacksmith.class) {
|
||||
object = WorldGenVillageBlacksmith.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
} else if (oclass == WorldGenVillageHouse2.class) {
|
||||
object = WorldGenVillageHouse2.a(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
}
|
||||
|
||||
return (WorldGenVillagePiece) object;
|
||||
}
|
||||
|
||||
private static WorldGenVillagePiece c(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j, int k, int l, int i1) {
|
||||
int j1 = a(worldgenvillagestartpiece.e);
|
||||
|
||||
if (j1 <= 0) {
|
||||
return null;
|
||||
} else {
|
||||
int k1 = 0;
|
||||
|
||||
while (k1 < 5) {
|
||||
++k1;
|
||||
int l1 = random.nextInt(j1);
|
||||
Iterator iterator = worldgenvillagestartpiece.e.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
WorldGenVillagePieceWeight worldgenvillagepieceweight = (WorldGenVillagePieceWeight) iterator.next();
|
||||
|
||||
l1 -= worldgenvillagepieceweight.b;
|
||||
if (l1 < 0) {
|
||||
if (!worldgenvillagepieceweight.a(i1) || worldgenvillagepieceweight == worldgenvillagestartpiece.d && worldgenvillagestartpiece.e.size() > 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
WorldGenVillagePiece worldgenvillagepiece = a(worldgenvillagestartpiece, worldgenvillagepieceweight, list, random, i, j, k, l, i1);
|
||||
|
||||
if (worldgenvillagepiece != null) {
|
||||
++worldgenvillagepieceweight.c;
|
||||
worldgenvillagestartpiece.d = worldgenvillagepieceweight;
|
||||
if (!worldgenvillagepieceweight.a()) {
|
||||
worldgenvillagestartpiece.e.remove(worldgenvillagepieceweight);
|
||||
}
|
||||
|
||||
return worldgenvillagepiece;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StructureBoundingBox structureboundingbox = WorldGenVillageLight.a(worldgenvillagestartpiece, list, random, i, j, k, l);
|
||||
|
||||
if (structureboundingbox != null) {
|
||||
return new WorldGenVillageLight(worldgenvillagestartpiece, i1, random, structureboundingbox, l);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static StructurePiece d(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j, int k, int l, int i1) {
|
||||
if (i1 > 50) {
|
||||
return null;
|
||||
} else if (Math.abs(i - worldgenvillagestartpiece.c().a) <= 112 && Math.abs(k - worldgenvillagestartpiece.c().c) <= 112) {
|
||||
WorldGenVillagePiece worldgenvillagepiece = c(worldgenvillagestartpiece, list, random, i, j, k, l, i1 + 1);
|
||||
|
||||
if (worldgenvillagepiece != null) {
|
||||
int j1 = (worldgenvillagepiece.f.a + worldgenvillagepiece.f.d) / 2;
|
||||
int k1 = (worldgenvillagepiece.f.c + worldgenvillagepiece.f.f) / 2;
|
||||
int l1 = worldgenvillagepiece.f.d - worldgenvillagepiece.f.a;
|
||||
int i2 = worldgenvillagepiece.f.f - worldgenvillagepiece.f.c;
|
||||
int j2 = l1 > i2 ? l1 : i2;
|
||||
|
||||
if (worldgenvillagestartpiece.e().a(j1, k1, j2 / 2 + 4, WorldGenVillage.e)) {
|
||||
list.add(worldgenvillagepiece);
|
||||
worldgenvillagestartpiece.i.add(worldgenvillagepiece);
|
||||
return worldgenvillagepiece;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static StructurePiece e(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j, int k, int l, int i1) {
|
||||
if (i1 > 3 + worldgenvillagestartpiece.c) {
|
||||
return null;
|
||||
} else if (Math.abs(i - worldgenvillagestartpiece.c().a) <= 112 && Math.abs(k - worldgenvillagestartpiece.c().c) <= 112) {
|
||||
StructureBoundingBox structureboundingbox = WorldGenVillageRoad.a(worldgenvillagestartpiece, list, random, i, j, k, l);
|
||||
|
||||
if (structureboundingbox != null && structureboundingbox.b > 10) {
|
||||
WorldGenVillageRoad worldgenvillageroad = new WorldGenVillageRoad(worldgenvillagestartpiece, i1, random, structureboundingbox, l);
|
||||
int j1 = (worldgenvillageroad.f.a + worldgenvillageroad.f.d) / 2;
|
||||
int k1 = (worldgenvillageroad.f.c + worldgenvillageroad.f.f) / 2;
|
||||
int l1 = worldgenvillageroad.f.d - worldgenvillageroad.f.a;
|
||||
int i2 = worldgenvillageroad.f.f - worldgenvillageroad.f.c;
|
||||
int j2 = l1 > i2 ? l1 : i2;
|
||||
|
||||
if (worldgenvillagestartpiece.e().a(j1, k1, j2 / 2 + 4, WorldGenVillage.e)) {
|
||||
list.add(worldgenvillageroad);
|
||||
worldgenvillagestartpiece.j.add(worldgenvillageroad);
|
||||
return worldgenvillageroad;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static StructurePiece a(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j, int k, int l, int i1) {
|
||||
return d(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
}
|
||||
|
||||
static StructurePiece b(WorldGenVillageStartPiece worldgenvillagestartpiece, List list, Random random, int i, int j, int k, int l, int i1) {
|
||||
return e(worldgenvillagestartpiece, list, random, i, j, k, l, i1);
|
||||
}
|
||||
}
|
87
src/main/java/net/minecraft/server/WorldGenWitchHut.java
Normal file
87
src/main/java/net/minecraft/server/WorldGenWitchHut.java
Normal file
@ -0,0 +1,87 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class WorldGenWitchHut extends WorldGenScatteredPiece {
|
||||
|
||||
private boolean e;
|
||||
|
||||
public WorldGenWitchHut() {}
|
||||
|
||||
public WorldGenWitchHut(Random random, int i, int j) {
|
||||
super(random, i, 64, j, 7, 5, 9);
|
||||
}
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
nbttagcompound.setBoolean("Witch", this.e);
|
||||
}
|
||||
|
||||
protected void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
this.e = nbttagcompound.getBoolean("Witch");
|
||||
}
|
||||
|
||||
public boolean a(World world, Random random, StructureBoundingBox structureboundingbox) {
|
||||
if (!this.a(world, structureboundingbox, 0)) {
|
||||
return false;
|
||||
} else {
|
||||
this.a(world, structureboundingbox, 1, 1, 1, 5, 1, 7, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 1, 4, 2, 5, 4, 7, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 2, 1, 0, 4, 1, 0, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 2, 2, 2, 3, 3, 2, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 1, 2, 3, 1, 3, 6, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 5, 2, 3, 5, 3, 6, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 2, 2, 7, 4, 3, 7, Blocks.WOOD, 1, Blocks.WOOD, 1, false);
|
||||
this.a(world, structureboundingbox, 1, 0, 2, 1, 3, 2, Blocks.LOG, Blocks.LOG, false);
|
||||
this.a(world, structureboundingbox, 5, 0, 2, 5, 3, 2, Blocks.LOG, Blocks.LOG, false);
|
||||
this.a(world, structureboundingbox, 1, 0, 7, 1, 3, 7, Blocks.LOG, Blocks.LOG, false);
|
||||
this.a(world, structureboundingbox, 5, 0, 7, 5, 3, 7, Blocks.LOG, Blocks.LOG, false);
|
||||
this.a(world, Blocks.FENCE, 0, 2, 3, 2, structureboundingbox);
|
||||
this.a(world, Blocks.FENCE, 0, 3, 3, 7, structureboundingbox);
|
||||
this.a(world, Blocks.AIR, 0, 1, 3, 4, structureboundingbox);
|
||||
this.a(world, Blocks.AIR, 0, 5, 3, 4, structureboundingbox);
|
||||
this.a(world, Blocks.AIR, 0, 5, 3, 5, structureboundingbox);
|
||||
this.a(world, Blocks.FLOWER_POT, 7, 1, 3, 5, structureboundingbox);
|
||||
this.a(world, Blocks.WORKBENCH, 0, 3, 2, 6, structureboundingbox);
|
||||
this.a(world, Blocks.CAULDRON, 0, 4, 2, 6, structureboundingbox);
|
||||
this.a(world, Blocks.FENCE, 0, 1, 2, 1, structureboundingbox);
|
||||
this.a(world, Blocks.FENCE, 0, 5, 2, 1, structureboundingbox);
|
||||
int i = this.a(Blocks.WOOD_STAIRS, 3);
|
||||
int j = this.a(Blocks.WOOD_STAIRS, 1);
|
||||
int k = this.a(Blocks.WOOD_STAIRS, 0);
|
||||
int l = this.a(Blocks.WOOD_STAIRS, 2);
|
||||
|
||||
this.a(world, structureboundingbox, 0, 4, 1, 6, 4, 1, Blocks.SPRUCE_WOOD_STAIRS, i, Blocks.SPRUCE_WOOD_STAIRS, i, false);
|
||||
this.a(world, structureboundingbox, 0, 4, 2, 0, 4, 7, Blocks.SPRUCE_WOOD_STAIRS, k, Blocks.SPRUCE_WOOD_STAIRS, k, false);
|
||||
this.a(world, structureboundingbox, 6, 4, 2, 6, 4, 7, Blocks.SPRUCE_WOOD_STAIRS, j, Blocks.SPRUCE_WOOD_STAIRS, j, false);
|
||||
this.a(world, structureboundingbox, 0, 4, 8, 6, 4, 8, Blocks.SPRUCE_WOOD_STAIRS, l, Blocks.SPRUCE_WOOD_STAIRS, l, false);
|
||||
|
||||
int i1;
|
||||
int j1;
|
||||
|
||||
for (i1 = 2; i1 <= 7; i1 += 5) {
|
||||
for (j1 = 1; j1 <= 5; j1 += 4) {
|
||||
this.b(world, Blocks.LOG, 0, j1, -1, i1, structureboundingbox);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.e) {
|
||||
i1 = this.a(2, 5);
|
||||
j1 = this.a(2);
|
||||
int k1 = this.b(2, 5);
|
||||
|
||||
if (structureboundingbox.b(i1, j1, k1)) {
|
||||
this.e = true;
|
||||
EntityWitch entitywitch = new EntityWitch(world);
|
||||
|
||||
entitywitch.setPositionRotation((double) i1 + 0.5D, (double) j1, (double) k1 + 0.5D, 0.0F, 0.0F);
|
||||
entitywitch.a((GroupDataEntity) null);
|
||||
world.addEntity(entitywitch);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user