();
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/StatisticCollector.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class StatisticCollector {
4 |
5 | private static StatisticStorage a = StatisticStorage.a();
6 |
7 | public StatisticCollector() {
8 | }
9 |
10 | public static String a(String s) {
11 | return a.a(s);
12 | }
13 |
14 | public static String a(String s, Object... aobject) {
15 | return a.a(s, aobject);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/plugin/PluginLoadOrder.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.plugin;
2 |
3 | /**
4 | * Represents the order in which a plugin should be initialized and enabled
5 | */
6 | public enum PluginLoadOrder {
7 | /**
8 | * Indicates that the plugin will be loaded at startup
9 | */
10 | STARTUP,
11 | /**
12 | * Indicates that the plugin will be loaded after the first/default world was created
13 | */
14 | POSTWORLD
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.util;
2 |
3 | import net.minecraft.server.MinecraftServer;
4 |
5 | public class ServerShutdownThread extends Thread {
6 | private final MinecraftServer server;
7 |
8 | public ServerShutdownThread(MinecraftServer server) {
9 | this.server = server;
10 | }
11 |
12 | @Override
13 | public void run() {
14 | server.stop();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/LightningStrike.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents an instance of a lightning strike. May or may not do damage.
5 | *
6 | * @author sk89q
7 | */
8 | public interface LightningStrike extends Weather {
9 |
10 | /**
11 | * Returns whether the strike is an effect that does no damage.
12 | *
13 | * @return whether the strike is an effect
14 | */
15 | public boolean isEffect();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/PistonBlockTextures.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class PistonBlockTextures {
4 |
5 | public static final int[] a = new int[] { 1, 0, 3, 2, 5, 4 };
6 | public static final int[] b = new int[] { 0, 0, 0, 0, -1, 1 };
7 | public static final int[] c = new int[] { -1, 1, 0, 0, 0, 0 };
8 | public static final int[] d = new int[] { 0, 0, -1, 1, 0, 0 };
9 |
10 | public PistonBlockTextures() {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/StorageMinecart.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | import org.bukkit.inventory.Inventory;
4 |
5 | /**
6 | * Represents a storage minecart.
7 | *
8 | * @author sk89q
9 | */
10 | public interface StorageMinecart extends Minecart {
11 |
12 | /**
13 | * Return the inventory object for this StorageMinecart.
14 | *
15 | * @return The inventory for this Minecart
16 | */
17 | public Inventory getInventory();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/painting/PaintingBreakByWorldEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.painting;
2 |
3 | import org.bukkit.entity.Painting;
4 |
5 | /**
6 | * Triggered when a painting is removed by the world (water flowing over it, block damaged behind it)
7 | */
8 | public class PaintingBreakByWorldEvent extends PaintingBreakEvent {
9 | public PaintingBreakByWorldEvent(final Painting painting) {
10 | super(painting, RemoveCause.WORLD);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/Effect.java:
--------------------------------------------------------------------------------
1 | package org.bukkit;
2 |
3 | /**
4 | * A list of effects that the server is able to send to players.
5 | */
6 | public enum Effect {
7 | BOW_FIRE(1002), CLICK1(1001), CLICK2(1000), DOOR_TOGGLE(1003), EXTINGUISH(1004), RECORD_PLAY(1005), SMOKE(2000), STEP_SOUND(2001);
8 |
9 | private final int id;
10 |
11 | Effect(int id) {
12 | this.id = id;
13 | }
14 |
15 | public int getId() {
16 | return this.id;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/util/config/ConfigurationException.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.util.config;
2 |
3 | /**
4 | * Configuration exception.
5 | *
6 | * @author sk89q
7 | */
8 | public class ConfigurationException extends Exception {
9 | private static final long serialVersionUID = -2442886939908724203L;
10 |
11 | public ConfigurationException() {
12 | super();
13 | }
14 |
15 | public ConfigurationException(String msg) {
16 | super(msg);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/CounterStatistic.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class CounterStatistic extends Statistic {
4 |
5 | public CounterStatistic(int i, String s, Counter counter) {
6 | super(i, s, counter);
7 | }
8 |
9 | public CounterStatistic(int i, String s) {
10 | super(i, s);
11 | }
12 |
13 | public Statistic d() {
14 | super.d();
15 | StatisticList.c.add(this);
16 | return this;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/IInventory.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public interface IInventory {
4 |
5 | int getSize();
6 |
7 | ItemStack getItem(int i);
8 |
9 | ItemStack splitStack(int i, int j);
10 |
11 | void setItem(int i, ItemStack itemstack);
12 |
13 | String getName();
14 |
15 | int getMaxStackSize();
16 |
17 | void update();
18 |
19 | boolean a_(EntityHuman entityhuman);
20 |
21 | ItemStack[] getContents(); // CraftBukkit
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/MaterialLogic.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class MaterialLogic extends Material {
4 |
5 | public MaterialLogic(MaterialMapColor materialmapcolor) {
6 | super(materialmapcolor);
7 | }
8 |
9 | public boolean isBuildable() {
10 | return false;
11 | }
12 |
13 | public boolean blocksLight() {
14 | return false;
15 | }
16 |
17 | public boolean isSolid() {
18 | return false;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WorldMapOrienter.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class WorldMapOrienter {
4 |
5 | public byte a;
6 | public byte b;
7 | public byte c;
8 | public byte d;
9 |
10 | final WorldMap e;
11 |
12 | public WorldMapOrienter(WorldMap worldmap, byte b0, byte b1, byte b2, byte b3) {
13 | this.e = worldmap;
14 | this.a = b0;
15 | this.b = b1;
16 | this.c = b2;
17 | this.d = b3;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/material/Directional.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.material;
2 |
3 | import org.bukkit.block.BlockFace;
4 |
5 | public interface Directional {
6 |
7 | /**
8 | * Sets the direction that this block is facing in
9 | */
10 | public void setFacingDirection(BlockFace face);
11 |
12 | /**
13 | * Gets the direction this block is facing
14 | *
15 | * @return the direction this block is facing
16 | */
17 | public BlockFace getFacing();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/EnumBedError.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public enum EnumBedError {
4 |
5 | OK("OK", 0), NOT_POSSIBLE_HERE("NOT_POSSIBLE_HERE", 1), NOT_POSSIBLE_NOW("NOT_POSSIBLE_NOW", 2), TOO_FAR_AWAY("TOO_FAR_AWAY", 3), OTHER_PROBLEM("OTHER_PROBLEM", 4);
6 |
7 | private static final EnumBedError[] f = new EnumBedError[] { OK, NOT_POSSIBLE_HERE, NOT_POSSIBLE_NOW, TOO_FAR_AWAY, OTHER_PROBLEM };
8 |
9 | private EnumBedError(String s, int i) {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/IChunkProvider.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public interface IChunkProvider {
4 |
5 | boolean isChunkLoaded(int i, int j);
6 |
7 | Chunk getOrCreateChunk(int i, int j);
8 |
9 | Chunk getChunkAt(int i, int j);
10 |
11 | void getChunkAt(IChunkProvider ichunkprovider, int i, int j);
12 |
13 | boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate);
14 |
15 | boolean unloadChunks();
16 |
17 | boolean canSave();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/MaterialPortal.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class MaterialPortal extends Material {
4 |
5 | public MaterialPortal(MaterialMapColor materialmapcolor) {
6 | super(materialmapcolor);
7 | }
8 |
9 | public boolean isBuildable() {
10 | return false;
11 | }
12 |
13 | public boolean blocksLight() {
14 | return false;
15 | }
16 |
17 | public boolean isSolid() {
18 | return false;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagEnd.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 |
6 | public class NBTTagEnd extends NBTBase {
7 |
8 | public NBTTagEnd() {
9 | }
10 |
11 | void a(DataInput datainput) {
12 | }
13 |
14 | void a(DataOutput dataoutput) {
15 | }
16 |
17 | public byte a() {
18 | return (byte) 0;
19 | }
20 |
21 | public String toString() {
22 | return "END";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/GuiStatsListener.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.awt.event.ActionEvent;
4 | import java.awt.event.ActionListener;
5 |
6 | class GuiStatsListener implements ActionListener {
7 |
8 | final GuiStatsComponent a;
9 |
10 | GuiStatsListener(GuiStatsComponent guistatscomponent) {
11 | this.a = guistatscomponent;
12 | }
13 |
14 | public void actionPerformed(ActionEvent actionevent) {
15 | GuiStatsComponent.a(this.a);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/block/Dispenser.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.block;
2 |
3 | /**
4 | * Represents a dispenser.
5 | *
6 | * @author sk89q
7 | */
8 | public interface Dispenser extends BlockState, ContainerBlock {
9 |
10 | /**
11 | * Attempts to dispense the contents of this block
12 | *
13 | * If the block is no longer a dispenser, this will return false
14 | *
15 | * @return true if successful, otherwise false
16 | */
17 | public boolean dispense();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftCow.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityCow;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Cow;
6 |
7 | public class CraftCow extends CraftAnimals implements Cow {
8 |
9 | public CraftCow(CraftServer server, EntityCow entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftCow";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol4.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol4 extends Protocol5 {
4 |
5 | @Override
6 | public boolean canReceivePacket(int id) {
7 | switch (id) {
8 | case 8: // health update
9 | case 9: // respawn
10 | case 38: // entity status
11 | return false;
12 | default:
13 | return super.canReceivePacket(id);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.World;
4 | import org.bukkit.entity.Player;
5 |
6 | public class PlayerChangedWorldEvent extends PlayerEvent {
7 |
8 | private final World from;
9 |
10 | public PlayerChangedWorldEvent(Player player, World from) {
11 | super(Type.PLAYER_CHANGED_WORLD, player);
12 | this.from = from;
13 | }
14 |
15 | public World getFrom() {
16 | return from;
17 | }
18 | }
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol3.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol3 extends Protocol4 {
4 |
5 | @Override
6 | public boolean canReceivePacket(int id) {
7 | switch (id) {
8 | case 7: // use entity
9 | case 28: // entity velocity
10 | case 39: // entity attach
11 | return false;
12 | default:
13 | return super.canReceivePacket(id);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Slime.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.bukkit.entity;
5 |
6 | /**
7 | * Represents a Slime.
8 | *
9 | * @author Cogito
10 | *
11 | */
12 | public interface Slime extends LivingEntity {
13 |
14 | /**
15 | * @author Celtic Minstrel
16 | * @return The size of the slime
17 | */
18 | public int getSize();
19 |
20 | /**
21 | * @author Celtic Minstrel
22 | * @param sz The new size of the slime.
23 | */
24 | public void setSize(int sz);
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/extension/Protocol2000.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol.extension;
2 |
3 | import uk.betacraft.uberbukkit.protocol.Protocol;
4 |
5 | public class Protocol2000 implements Protocol {
6 |
7 | public boolean canReceiveBlockItem(int id) {
8 | return true;
9 | }
10 |
11 | public boolean canReceivePacket(int id) {
12 | return true;
13 | }
14 |
15 | public boolean canSeeMob(Class> claz) {
16 | return true;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/block/Action.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.block;
2 |
3 | public enum Action {
4 |
5 | /**
6 | * Left-clicking a block
7 | */
8 | LEFT_CLICK_BLOCK,
9 | /**
10 | * Right-clicking a block
11 | */
12 | RIGHT_CLICK_BLOCK,
13 | /**
14 | * Left-clicking the air
15 | */
16 | LEFT_CLICK_AIR,
17 | /**
18 | * Right-clicking the air
19 | */
20 | RIGHT_CLICK_AIR,
21 | /**
22 | * Ass-pressure
23 | */
24 | PHYSICAL,
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityGhast;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Ghast;
6 |
7 | public class CraftGhast extends CraftFlying implements Ghast {
8 |
9 | public CraftGhast(CraftServer server, EntityGhast entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftGhast";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftSquid.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntitySquid;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Squid;
6 |
7 | public class CraftSquid extends CraftWaterMob implements Squid {
8 |
9 | public CraftSquid(CraftServer server, EntitySquid entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftSquid";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityZombie;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Zombie;
6 |
7 | public class CraftZombie extends CraftMonster implements Zombie {
8 |
9 | public CraftZombie(CraftServer server, EntityZombie entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftZombie";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Pig.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents a Pig.
5 | */
6 | public interface Pig extends Animals, Vehicle {
7 |
8 | /**
9 | * Check if the pig has a saddle.
10 | *
11 | * @return if the pig has been saddled.
12 | */
13 | public boolean hasSaddle();
14 |
15 | /**
16 | * Sets if the pig has a saddle or not
17 | *
18 | * @param saddled set if the pig has a saddle or not.
19 | */
20 | public void setSaddle(boolean saddled);
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.Chunk;
4 | import org.bukkit.generator.BlockPopulator;
5 |
6 | /**
7 | * Thrown when a new chunk has finished being populated.
8 | *
9 | * If your intent is to populate the chunk using this event, please see {@link BlockPopulator}
10 | */
11 | public class ChunkPopulateEvent extends ChunkEvent {
12 | public ChunkPopulateEvent(final Chunk chunk) {
13 | super(Type.CHUNK_POPULATED, chunk);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/MaterialLiquid.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class MaterialLiquid extends Material {
4 |
5 | public MaterialLiquid(MaterialMapColor materialmapcolor) {
6 | super(materialmapcolor);
7 | this.f();
8 | this.k();
9 | }
10 |
11 | public boolean isLiquid() {
12 | return true;
13 | }
14 |
15 | public boolean isSolid() {
16 | return false;
17 | }
18 |
19 | public boolean isBuildable() {
20 | return false;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/MaterialTransparent.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class MaterialTransparent extends Material {
4 |
5 | public MaterialTransparent(MaterialMapColor materialmapcolor) {
6 | super(materialmapcolor);
7 | this.f();
8 | }
9 |
10 | public boolean isBuildable() {
11 | return false;
12 | }
13 |
14 | public boolean blocksLight() {
15 | return false;
16 | }
17 |
18 | public boolean isSolid() {
19 | return false;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityChicken;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Chicken;
6 |
7 | public class CraftChicken extends CraftAnimals implements Chicken {
8 |
9 | public CraftChicken(CraftServer server, EntityChicken entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftChicken";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftSpider.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntitySpider;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Spider;
6 |
7 | public class CraftSpider extends CraftMonster implements Spider {
8 |
9 | public CraftSpider(CraftServer server, EntitySpider entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftSpider";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Creeper.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents a Creeper
5 | */
6 | public interface Creeper extends Monster {
7 |
8 | /**
9 | * Checks if this Creeper is powered (Electrocuted)
10 | *
11 | * @return true if this creeper is powered
12 | */
13 | public boolean isPowered();
14 |
15 | /**
16 | * Sets the Powered status of this Creeper
17 | *
18 | * @param value New Powered status
19 | */
20 | public void setPowered(boolean value);
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityFlying;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Flying;
6 |
7 | public class CraftFlying extends CraftLivingEntity implements Flying {
8 |
9 | public CraftFlying(CraftServer server, EntityFlying entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftFlying";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftGiant.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityGiantZombie;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Giant;
6 |
7 | public class CraftGiant extends CraftMonster implements Giant {
8 |
9 | public CraftGiant(CraftServer server, EntityGiantZombie entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftGiant";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftVehicle.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import org.bukkit.craftbukkit.CraftServer;
4 | import org.bukkit.entity.Vehicle;
5 |
6 | public abstract class CraftVehicle extends CraftEntity implements Vehicle {
7 | public CraftVehicle(CraftServer server, net.minecraft.server.Entity entity) {
8 | super(server, entity);
9 | }
10 |
11 | @Override
12 | public String toString() {
13 | return "CraftVehicle{passenger=" + getPassenger() + '}';
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.entity.Player;
4 |
5 | /**
6 | * Called early in the command handling process. This event is only
7 | * for very exceptional cases and you should not normally use it.
8 | */
9 | public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
10 | public PlayerCommandPreprocessEvent(final Player player, final String message) {
11 | super(Type.PLAYER_COMMAND_PREPROCESS, player, message);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/legacyminecraft/poseidon/util/HTTPResponse.java:
--------------------------------------------------------------------------------
1 | package com.legacyminecraft.poseidon.util;
2 |
3 | public class HTTPResponse {
4 | private String response;
5 | private int responseCode;
6 |
7 | public HTTPResponse(String response, int responseCode) {
8 | this.response = response;
9 | this.responseCode = responseCode;
10 | }
11 |
12 | public String getResponse() {
13 | return response;
14 | }
15 |
16 | public int getResponseCode() {
17 | return responseCode;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.permissions;
2 |
3 | /**
4 | * Represents a class which is to be notified when a {@link PermissionAttachment} is removed from a {@link Permissible}
5 | */
6 | public interface PermissionRemovedExecutor {
7 | /**
8 | * Called when a {@link PermissionAttachment} is removed from a {@link Permissible}
9 | *
10 | * @param attachment Attachment which was removed
11 | */
12 | public void attachmentRemoved(PermissionAttachment attachment);
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/IDataManager.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.File;
4 | import java.util.List;
5 | import java.util.UUID;
6 |
7 | public interface IDataManager {
8 |
9 | WorldData c();
10 |
11 | void b();
12 |
13 | IChunkLoader a(WorldProvider worldprovider);
14 |
15 | void a(WorldData worlddata, List list);
16 |
17 | void a(WorldData worlddata);
18 |
19 | PlayerFileData d();
20 |
21 | void e();
22 |
23 | File b(String s);
24 |
25 | UUID getUUID(); // CraftBukkit
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityPainting;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Painting;
6 |
7 | public class CraftPainting extends CraftEntity implements Painting {
8 |
9 | public CraftPainting(CraftServer server, EntityPainting entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftPainting";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntitySkeleton;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Skeleton;
6 |
7 | public class CraftSkeleton extends CraftMonster implements Skeleton {
8 |
9 | public CraftSkeleton(CraftServer server, EntitySkeleton entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftSkeleton";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftWaterMob.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityWaterAnimal;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.WaterMob;
6 |
7 | public class CraftWaterMob extends CraftCreature implements WaterMob {
8 |
9 | public CraftWaterMob(CraftServer server, EntityWaterAnimal entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftWaterMob";
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Vehicle.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | import org.bukkit.util.Vector;
4 |
5 | /**
6 | * Represents a vehicle entity.
7 | *
8 | * @author sk89q
9 | */
10 | public interface Vehicle extends Entity {
11 |
12 | /**
13 | * Gets the vehicle's velocity.
14 | *
15 | * @return velocity vector
16 | */
17 | public Vector getVelocity();
18 |
19 | /**
20 | * Sets the vehicle's velocity.
21 | *
22 | * @param vel velocity vector
23 | */
24 | public void setVelocity(Vector vel);
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ChunkBuffer.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.ByteArrayOutputStream;
4 |
5 | class ChunkBuffer extends ByteArrayOutputStream {
6 |
7 | private int b;
8 | private int c;
9 |
10 | final RegionFile a;
11 |
12 | public ChunkBuffer(RegionFile regionfile, int i, int j) {
13 | super(8096);
14 | this.a = regionfile;
15 | this.b = i;
16 | this.c = j;
17 | }
18 |
19 | public void close() {
20 | this.a.a(this.b, this.c, this.buf, this.count);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/command/defaults/VanillaCommand.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.command.defaults;
2 |
3 | import org.bukkit.command.Command;
4 |
5 | import java.util.List;
6 |
7 | public abstract class VanillaCommand extends Command {
8 | protected VanillaCommand(String name) {
9 | super(name);
10 | }
11 |
12 | protected VanillaCommand(String name, String description, String usageMessage, List aliases) {
13 | super(name, description, usageMessage, aliases);
14 | }
15 |
16 | public abstract boolean matches(String input);
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingSand.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityFallingSand;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.FallingSand;
6 |
7 | public class CraftFallingSand extends CraftEntity implements FallingSand {
8 |
9 | public CraftFallingSand(CraftServer server, EntityFallingSand entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftFallingSand";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/me/devcody/uberbukkit/math/Vec3i.java:
--------------------------------------------------------------------------------
1 | package me.devcody.uberbukkit.math;
2 |
3 | public class Vec3i extends Vec3 {
4 | public Vec3i(int x, int y, int z) {
5 | super(x, y, z);
6 | }
7 |
8 | public Vec3i add(Vec3i vec) {
9 | return new Vec3i(x + vec.x, y + vec.y, z + vec.z);
10 | }
11 |
12 | public Vec3i subtract(Vec3i vec) {
13 | return new Vec3i(x - vec.x, y - vec.y, z - vec.z);
14 | }
15 |
16 | public Vec3i abs() {
17 | return new Vec3i(Math.abs(x), Math.abs(y), Math.abs(z));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftWeather.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityWeather;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Weather;
6 |
7 | public class CraftWeather extends CraftEntity implements Weather {
8 | public CraftWeather(final CraftServer server, final EntityWeather entity) {
9 | super(server, entity);
10 | }
11 |
12 | @Override
13 | public EntityWeather getHandle() {
14 | return (EntityWeather) super.getHandle();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet0KeepAlive.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 |
6 | public class Packet0KeepAlive extends Packet {
7 |
8 | public Packet0KeepAlive() {
9 | }
10 |
11 | public void a(NetHandler nethandler) {
12 | nethandler.a(this);
13 | }
14 |
15 | public void a(DataInputStream datainputstream) {
16 | }
17 |
18 | public void a(DataOutputStream dataoutputstream) {
19 | }
20 |
21 | public int a() {
22 | return 0;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Boat.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents a boat entity.
5 | *
6 | * @author sk89q
7 | */
8 | public interface Boat extends Vehicle {
9 |
10 | /**
11 | * Gets the maximum speed of a boat. The speed is unrelated to the velocity.
12 | *
13 | * @param speed
14 | */
15 | public double getMaxSpeed();
16 |
17 | /**
18 | * Sets the maximum speed of a boat. Must be nonnegative. Default is 0.4D.
19 | *
20 | * @param speed
21 | */
22 | public void setMaxSpeed(double speed);
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/EntityGiantZombie.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class EntityGiantZombie extends EntityMonster {
4 |
5 | public EntityGiantZombie(World world) {
6 | super(world);
7 | this.texture = "/mob/zombie.png";
8 | this.aE = 0.5F;
9 | this.damage = 50;
10 | this.health *= 10;
11 | this.height *= 6.0F;
12 | this.b(this.length * 6.0F, this.width * 6.0F);
13 | }
14 |
15 | protected float a(int i, int j, int k) {
16 | return this.world.n(i, j, k) - 0.5F;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Item.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | import org.bukkit.inventory.ItemStack;
4 |
5 | /**
6 | * Represents an Item.
7 | *
8 | * @author Cogito
9 | */
10 | public interface Item extends Entity {
11 |
12 | /**
13 | * Gets the item stack associated with this item drop.
14 | *
15 | * @return
16 | */
17 | public ItemStack getItemStack();
18 |
19 | /**
20 | * Sets the item stack associated with this item drop.
21 | *
22 | * @param stack
23 | */
24 | public void setItemStack(ItemStack stack);
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftPoweredMinecart.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityMinecart;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.PoweredMinecart;
6 |
7 | public class CraftPoweredMinecart extends CraftMinecart implements PoweredMinecart {
8 | public CraftPoweredMinecart(CraftServer server, EntityMinecart entity) {
9 | super(server, entity);
10 | }
11 |
12 | @Override
13 | public String toString() {
14 | return "CraftPoweredMinecart";
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/SecondaryWorldServer.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import org.bukkit.generator.ChunkGenerator;
4 |
5 | public class SecondaryWorldServer extends WorldServer {
6 | // CraftBukkit start
7 | public SecondaryWorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, long j, WorldServer worldserver, org.bukkit.World.Environment env, ChunkGenerator gen) {
8 | super(minecraftserver, idatamanager, s, i, j, env, gen);
9 | // CraftBukkit end
10 | this.worldMaps = worldserver.worldMaps;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Sheep.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.bukkit.entity;
5 |
6 | import org.bukkit.material.Colorable;
7 |
8 | /**
9 | * Represents a Sheep.
10 | *
11 | * @author Cogito
12 | *
13 | */
14 | public interface Sheep extends Animals, Colorable {
15 |
16 | /**
17 | * @author Celtic Minstrel
18 | * @return Whether the sheep is sheared.
19 | */
20 | public boolean isSheared();
21 |
22 | /**
23 | * @author Celtic Minstrel
24 | * @param flag Whether to shear the sheep
25 | */
26 | public void setSheared(boolean flag);
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/TNTPrimed.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents a Primed TNT.
5 | */
6 | public interface TNTPrimed extends Explosive {
7 | /**
8 | * Set the number of ticks until the TNT blows up after being primed.
9 | *
10 | * @param fuseTicks
11 | */
12 | public void setFuseTicks(int fuseTicks);
13 |
14 | /**
15 | * Retrieve the number of ticks until the explosion of this TNTPrimed entity
16 | *
17 | * @return the number of ticks until this TNTPrimed explodes
18 | */
19 | public int getFuseTicks();
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/StepSound.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class StepSound {
4 |
5 | public final String a;
6 | public final float b;
7 | public final float c;
8 |
9 | public StepSound(String s, float f, float f1) {
10 | this.a = s;
11 | this.b = f;
12 | this.c = f1;
13 | }
14 |
15 | public float getVolume1() {
16 | return this.b;
17 | }
18 |
19 | public float getVolume2() {
20 | return this.c;
21 | }
22 |
23 | public String getName() {
24 | return "step." + this.a;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/TileEntityRecordPlayer.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class TileEntityRecordPlayer extends TileEntity {
4 |
5 | public int a;
6 |
7 | public TileEntityRecordPlayer() {
8 | }
9 |
10 | public void a(NBTTagCompound nbttagcompound) {
11 | super.a(nbttagcompound);
12 | this.a = nbttagcompound.e("Record");
13 | }
14 |
15 | public void b(NBTTagCompound nbttagcompound) {
16 | super.b(nbttagcompound);
17 | if (this.a > 0) {
18 | nbttagcompound.a("Record", this.a);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol13.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol13 extends Protocol14 {
4 |
5 | @Override
6 | public boolean canReceiveBlockItem(int id) {
7 | switch (id) {
8 | case 29: // piston
9 | case 33: // sticky piston
10 | case 34: // piston extension
11 | case 36: // piston moving piece
12 | case 359: // shears
13 | return false;
14 | default:
15 | return super.canReceiveBlockItem(id);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemEgg.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemEgg extends Item {
4 |
5 | public ItemEgg(int i) {
6 | super(i);
7 | this.maxStackSize = 16;
8 | }
9 |
10 | public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
11 | --itemstack.count;
12 | world.makeSound(entityhuman, "random.bow", 0.5F, 0.4F / (b.nextFloat() * 0.4F + 0.8F));
13 | if (!world.isStatic) {
14 | world.addEntity(new EntityEgg(world, entityhuman));
15 | }
16 |
17 | return itemstack;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/ChunkEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.Chunk;
4 |
5 | /**
6 | * Represents a Chunk related event
7 | */
8 | public class ChunkEvent extends WorldEvent {
9 | protected Chunk chunk;
10 |
11 | protected ChunkEvent(Type type, Chunk chunk) {
12 | super(type, chunk.getWorld());
13 | this.chunk = chunk;
14 | }
15 |
16 | /**
17 | * Gets the chunk being loaded/unloaded
18 | *
19 | * @return Chunk that triggered this event
20 | */
21 | public Chunk getChunk() {
22 | return chunk;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockMobSpawner.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class BlockMobSpawner extends BlockContainer {
6 |
7 | protected BlockMobSpawner(int i, int j) {
8 | super(i, j, Material.STONE);
9 | }
10 |
11 | protected TileEntity a_() {
12 | return new TileEntityMobSpawner();
13 | }
14 |
15 | public int a(int i, Random random) {
16 | return 0;
17 | }
18 |
19 | public int a(Random random) {
20 | return 0;
21 | }
22 |
23 | public boolean a() {
24 | return false;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemSnowball.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemSnowball extends Item {
4 |
5 | public ItemSnowball(int i) {
6 | super(i);
7 | this.maxStackSize = 16;
8 | }
9 |
10 | public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
11 | --itemstack.count;
12 | world.makeSound(entityhuman, "random.bow", 0.5F, 0.4F / (b.nextFloat() * 0.4F + 0.8F));
13 | if (!world.isStatic) {
14 | world.addEntity(new EntitySnowball(world, entityhuman));
15 | }
16 |
17 | return itemstack;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WorldMapBase.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public abstract class WorldMapBase {
4 |
5 | public final String a;
6 | private boolean b;
7 |
8 | public WorldMapBase(String s) {
9 | this.a = s;
10 | }
11 |
12 | public abstract void a(NBTTagCompound nbttagcompound);
13 |
14 | public abstract void b(NBTTagCompound nbttagcompound);
15 |
16 | public void a() {
17 | this.a(true);
18 | }
19 |
20 | public void a(boolean flag) {
21 | this.b = flag;
22 | }
23 |
24 | public boolean b() {
25 | return this.b;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/material/Colorable.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.material;
2 |
3 | import org.bukkit.DyeColor;
4 |
5 | /**
6 | * An object that can be colored.
7 | *
8 | * @author Cogito
9 | */
10 | public interface Colorable {
11 |
12 | /**
13 | * Gets the color of this object.
14 | *
15 | * @return The DyeColor of this object.
16 | */
17 | public DyeColor getColor();
18 |
19 | /**
20 | * Sets the color of this object to the specified DyeColor.
21 | *
22 | * @param color The color of the object, as a DyeColor.
23 | */
24 | public void setColor(DyeColor color);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockDeadBush.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class BlockDeadBush extends BlockFlower {
6 |
7 | protected BlockDeadBush(int i, int j) {
8 | super(i, j);
9 | float f = 0.4F;
10 |
11 | this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
12 | }
13 |
14 | protected boolean c(int i) {
15 | return i == Block.SAND.id;
16 | }
17 |
18 | public int a(int i, int j) {
19 | return this.textureId;
20 | }
21 |
22 | public int a(int i, Random random) {
23 | return -1;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/server/PluginEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.server;
2 |
3 | import org.bukkit.plugin.Plugin;
4 |
5 | /**
6 | * Used for plugin enable and disable events
7 | */
8 | public class PluginEvent extends ServerEvent {
9 | private final Plugin plugin;
10 |
11 | public PluginEvent(final Type type, final Plugin plugin) {
12 | super(type);
13 |
14 | this.plugin = plugin;
15 | }
16 |
17 | /**
18 | * Gets the plugin involved in this event
19 | *
20 | * @return Plugin for this event
21 | */
22 | public Plugin getPlugin() {
23 | return plugin;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.Chunk;
4 | import org.bukkit.event.Cancellable;
5 |
6 | /**
7 | * Called when a chunk is unloaded
8 | */
9 | public class ChunkUnloadEvent extends ChunkEvent implements Cancellable {
10 | private boolean cancel = false;
11 |
12 | public ChunkUnloadEvent(final Chunk chunk) {
13 | super(Type.CHUNK_UNLOAD, chunk);
14 | }
15 |
16 | public boolean isCancelled() {
17 | return cancel;
18 | }
19 |
20 | public void setCancelled(boolean cancel) {
21 | this.cancel = cancel;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/permissions/ServerOperator.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.permissions;
2 |
3 | import org.bukkit.entity.Player;
4 |
5 | /**
6 | * Represents an object that may become a server operator, such as a {@link Player}
7 | */
8 | public interface ServerOperator {
9 | /**
10 | * Checks if this object is a server operator
11 | *
12 | * @return true if this is an operator, otherwise false
13 | */
14 | public boolean isOp();
15 |
16 | /**
17 | * Sets the operator status of this object
18 | *
19 | * @param value New operator value
20 | */
21 | public void setOp(boolean value);
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockSlowSand.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class BlockSlowSand extends Block {
4 |
5 | public BlockSlowSand(int i, int j) {
6 | super(i, j, Material.SAND);
7 | }
8 |
9 | public AxisAlignedBB e(World world, int i, int j, int k) {
10 | float f = 0.125F;
11 |
12 | return AxisAlignedBB.b((double) i, (double) j, (double) k, (double) (i + 1), (double) ((float) (j + 1) - f), (double) (k + 1));
13 | }
14 |
15 | public void a(World world, int i, int j, int k, Entity entity) {
16 | entity.motX *= 0.4D;
17 | entity.motZ *= 0.4D;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Fireball.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | import org.bukkit.util.Vector;
4 |
5 | /**
6 | * Represents a Fireball.
7 | */
8 | public interface Fireball extends Projectile, Explosive {
9 | /**
10 | * Fireballs fly straight and do not take setVelocity(...) well.
11 | *
12 | * @param direction the direction this fireball is flying toward
13 | */
14 | public void setDirection(Vector direction);
15 |
16 | /**
17 | * Retrieve the direction this fireball is heading toward
18 | *
19 | * @return the direction
20 | */
21 | public Vector getDirection();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.World;
4 | import org.bukkit.event.Cancellable;
5 |
6 | /**
7 | * Called when a World is unloaded
8 | */
9 | public class WorldUnloadEvent extends WorldEvent implements Cancellable {
10 | private boolean isCancelled;
11 |
12 | public WorldUnloadEvent(World world) {
13 | super(Type.WORLD_UNLOAD, world);
14 | }
15 |
16 | public boolean isCancelled() {
17 | return this.isCancelled;
18 | }
19 |
20 | public void setCancelled(boolean cancel) {
21 | this.isCancelled = cancel;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemArmor.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemArmor extends Item {
4 |
5 | private static final int[] bn = new int[] { 3, 8, 6, 3 };
6 | private static final int[] bo = new int[] { 11, 16, 15, 13 };
7 | public final int a;
8 | public final int bk;
9 | public final int bl;
10 | public final int bm;
11 |
12 | public ItemArmor(int i, int j, int k, int l) {
13 | super(i);
14 | this.a = j;
15 | this.bk = l;
16 | this.bm = k;
17 | this.bl = bn[l];
18 | this.d(bo[l] * 3 << j);
19 | this.maxStackSize = 1;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.Material;
4 | import org.bukkit.block.Block;
5 | import org.bukkit.block.BlockFace;
6 | import org.bukkit.entity.Player;
7 | import org.bukkit.inventory.ItemStack;
8 |
9 | /**
10 | * Called when a player fills a bucket
11 | */
12 | public class PlayerBucketFillEvent extends PlayerBucketEvent {
13 | public PlayerBucketFillEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
14 | super(Type.PLAYER_BUCKET_FILL, who, blockClicked, blockFace, bucket, itemInHand);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/inventory/Slot.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.inventory;
2 |
3 | /**
4 | * Represents a slot in an inventory
5 | */
6 | public interface Slot {
7 |
8 | /**
9 | * Gets the inventory this slot belongs to
10 | *
11 | * @return The inventory
12 | */
13 | public Inventory getInventory();
14 |
15 | /**
16 | * Get the index this slot belongs to
17 | *
18 | * @return Index of the slot
19 | */
20 | public int getIndex();
21 |
22 | /**
23 | * Get the item from the slot.
24 | *
25 | * @return ItemStack in the slot.
26 | */
27 | public ItemStack getItem();
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityAnimal;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Animals;
6 |
7 | public class CraftAnimals extends CraftCreature implements Animals {
8 |
9 | public CraftAnimals(CraftServer server, EntityAnimal entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftAnimals";
16 | }
17 |
18 | @Override
19 | public EntityAnimal getHandle() {
20 | return (EntityAnimal) entity;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol6.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol6 extends Protocol7 {
4 |
5 | @Override
6 | public boolean canReceivePacket(int id) {
7 | switch (id) {
8 | case 100: // inventory stuff -
9 | case 101:
10 | case 102:
11 | case 103:
12 | case 104:
13 | case 105:
14 | case 106: // - inventory stuff
15 | case 130: // sign edit
16 | return false;
17 | default:
18 | return super.canReceivePacket(id);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftMonster.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityMonster;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Monster;
6 |
7 | public class CraftMonster extends CraftCreature implements Monster {
8 |
9 | public CraftMonster(CraftServer server, EntityMonster entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftMonster";
16 | }
17 |
18 | @Override
19 | public EntityMonster getHandle() {
20 | return (EntityMonster) entity;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.Material;
4 | import org.bukkit.block.Block;
5 | import org.bukkit.block.BlockFace;
6 | import org.bukkit.entity.Player;
7 | import org.bukkit.inventory.ItemStack;
8 |
9 | /**
10 | * Called when a player empties a bucket
11 | */
12 | public class PlayerBucketEmptyEvent extends PlayerBucketEvent {
13 | public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
14 | super(Type.PLAYER_BUCKET_EMPTY, who, blockClicked, blockFace, bucket, itemInHand);
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/WorldEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.World;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents events within a world
8 | */
9 | public class WorldEvent extends Event {
10 | private final World world;
11 |
12 | public WorldEvent(final Type type, final World world) {
13 | super(type);
14 |
15 | this.world = world;
16 | }
17 |
18 | /**
19 | * Gets the world primarily involved with this event
20 | *
21 | * @return World which caused this event
22 | */
23 | public World getWorld() {
24 | return world;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/plugin/AuthorNagException.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.plugin;
2 |
3 | public class AuthorNagException extends RuntimeException {
4 | private final String message;
5 |
6 | /**
7 | * Constructs a new UnknownDependencyException based on the given Exception
8 | *
9 | * @param message Brief message explaining the cause of the exception
10 | * @param throwable Exception that triggered this Exception
11 | */
12 | public AuthorNagException(final String message) {
13 | this.message = message;
14 | }
15 |
16 | @Override
17 | public String getMessage() {
18 | return message;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/weather/WeatherEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.weather;
2 |
3 | import org.bukkit.World;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents a Weather-related event
8 | */
9 | public class WeatherEvent extends Event {
10 | protected World world;
11 |
12 | public WeatherEvent(final Event.Type type, final World where) {
13 | super(type);
14 | world = where;
15 | }
16 |
17 | /**
18 | * Returns the World where this event is occurring
19 | *
20 | * @return World this event is occurring in
21 | */
22 | public final World getWorld() {
23 | return world;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/block/BlockEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.block;
2 |
3 | import org.bukkit.block.Block;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents a block related event.
8 | */
9 | public class BlockEvent extends Event {
10 | protected Block block;
11 |
12 | public BlockEvent(final Event.Type type, final Block theBlock) {
13 | super(type);
14 | block = theBlock;
15 | }
16 |
17 | /**
18 | * Gets the block involved in this event.
19 | *
20 | * @return The Block which block is involved in this event
21 | */
22 | public final Block getBlock() {
23 | return block;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/EntityEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 | import org.bukkit.entity.Entity;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents an Entity-related event
8 | */
9 | public class EntityEvent extends Event {
10 | protected Entity entity;
11 |
12 | public EntityEvent(final Event.Type type, final Entity what) {
13 | super(type);
14 | entity = what;
15 | }
16 |
17 | /**
18 | * Returns the Entity involved in this event
19 | *
20 | * @return Entity who is involved in this event
21 | */
22 | public final Entity getEntity() {
23 | return entity;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.entity.Player;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents a player related event
8 | */
9 | public class PlayerEvent extends Event {
10 | protected Player player;
11 |
12 | public PlayerEvent(final Event.Type type, final Player who) {
13 | super(type);
14 | player = who;
15 | }
16 |
17 | /**
18 | * Returns the player involved in this event
19 | *
20 | * @return Player who is involved in this event
21 | */
22 | public final Player getPlayer() {
23 | return player;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockLongGrass.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class BlockLongGrass extends BlockFlower {
6 |
7 | protected BlockLongGrass(int i, int j) {
8 | super(i, j);
9 | float f = 0.4F;
10 |
11 | this.a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
12 | }
13 |
14 | public int a(int i, int j) {
15 | return j == 1 ? this.textureId : (j == 2 ? this.textureId + 16 + 1 : (j == 0 ? this.textureId + 16 : this.textureId));
16 | }
17 |
18 | public int a(int i, Random random) {
19 | return random.nextInt(8) == 0 ? Item.SEEDS.id : -1;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.vehicle;
2 |
3 | import org.bukkit.entity.Vehicle;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents a vehicle-related event.
8 | *
9 | * @author sk89q
10 | */
11 | public class VehicleEvent extends Event {
12 | protected Vehicle vehicle;
13 |
14 | public VehicleEvent(final Event.Type type, final Vehicle vehicle) {
15 | super(type);
16 | this.vehicle = vehicle;
17 | }
18 |
19 | /**
20 | * Get the vehicle.
21 | *
22 | * @return the vehicle
23 | */
24 | public final Vehicle getVehicle() {
25 | return vehicle;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/server/MapInitializeEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.server;
2 |
3 | import org.bukkit.event.Event;
4 | import org.bukkit.map.MapView;
5 |
6 | /**
7 | * Called when a map is initialized.
8 | */
9 | public class MapInitializeEvent extends ServerEvent {
10 | private final MapView mapView;
11 |
12 | public MapInitializeEvent(MapView mapView) {
13 | super(Event.Type.MAP_INITIALIZE);
14 | this.mapView = mapView;
15 | }
16 |
17 | /**
18 | * Gets the map initialized in this event.
19 | *
20 | * @return Map for this event
21 | */
22 | public MapView getMap() {
23 | return mapView;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/painting/PaintingEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.painting;
2 |
3 | import org.bukkit.entity.Painting;
4 | import org.bukkit.event.Event;
5 |
6 | /**
7 | * Represents a painting-related event.
8 | */
9 | public class PaintingEvent extends Event {
10 |
11 | protected Painting painting;
12 |
13 | protected PaintingEvent(final Type type, final Painting painting) {
14 | super(type);
15 | this.painting = painting;
16 | }
17 |
18 | /**
19 | * Gets the painting involved in this event.
20 | *
21 | * @return the painting
22 | */
23 | public Painting getPainting() {
24 | return painting;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ThreadMonitorConnection.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | class ThreadMonitorConnection extends Thread {
4 |
5 | final NetworkManager a;
6 |
7 | ThreadMonitorConnection(NetworkManager networkmanager) {
8 | this.a = networkmanager;
9 | }
10 |
11 | public void run() {
12 | try {
13 | Thread.sleep(2000L);
14 | if (NetworkManager.a(this.a)) {
15 | NetworkManager.h(this.a).interrupt();
16 | this.a.a("disconnect.closed", new Object[0]);
17 | }
18 | } catch (Exception exception) {
19 | exception.printStackTrace();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ThreadSleepForever.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ThreadSleepForever extends Thread {
4 |
5 | final MinecraftServer a;
6 |
7 | public ThreadSleepForever(MinecraftServer minecraftserver) {
8 | this.a = minecraftserver;
9 | this.setDaemon(true);
10 | this.start();
11 | }
12 |
13 | public void run() {
14 | while (true) {
15 | try {
16 | while (true) {
17 | Thread.sleep(2147483647L);
18 | }
19 | } catch (InterruptedException interruptedexception) {
20 | ;
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/command/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.command;
2 |
3 | /**
4 | * Represents a class which contains a single method for executing commands
5 | */
6 | public interface CommandExecutor {
7 |
8 | /**
9 | * Executes the given command, returning its success
10 | *
11 | * @param sender Source of the command
12 | * @param command Command which was executed
13 | * @param label Alias of the command which was used
14 | * @param args Passed command arguments
15 | * @return true if a valid command, otherwise false
16 | */
17 | public boolean onCommand(CommandSender sender, Command command, String label, String[] args);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockCloth.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class BlockCloth extends Block {
4 |
5 | public BlockCloth() {
6 | super(35, 64, Material.CLOTH);
7 | }
8 |
9 | public int a(int i, int j) {
10 | if (j == 0) {
11 | return this.textureId;
12 | } else {
13 | j = ~(j & 15);
14 | return 113 + ((j & 8) >> 3) + (j & 7) * 16;
15 | }
16 | }
17 |
18 | protected int a_(int i) {
19 | return i;
20 | }
21 |
22 | public static int c(int i) {
23 | return ~i & 15;
24 | }
25 |
26 | public static int d(int i) {
27 | return ~i & 15;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ChunkFilenameFilter.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.File;
4 | import java.io.FilenameFilter;
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | class ChunkFilenameFilter implements FilenameFilter {
9 |
10 | public static final Pattern a = Pattern.compile("c\\.(-?[0-9a-z]+)\\.(-?[0-9a-z]+)\\.dat");
11 |
12 | private ChunkFilenameFilter() {
13 | }
14 |
15 | public boolean accept(File file1, String s) {
16 | Matcher matcher = a.matcher(s);
17 |
18 | return matcher.matches();
19 | }
20 |
21 | ChunkFilenameFilter(EmptyClass2 emptyclass2) {
22 | this();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/RecipesCrafting.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class RecipesCrafting {
4 |
5 | public RecipesCrafting() {
6 | }
7 |
8 | public void a(CraftingManager craftingmanager) {
9 | craftingmanager.registerShapedRecipe(new ItemStack(Block.CHEST), new Object[] { "###", "# #", "###", Character.valueOf('#'), Block.WOOD });
10 | craftingmanager.registerShapedRecipe(new ItemStack(Block.FURNACE), new Object[] { "###", "# #", "###", Character.valueOf('#'), Block.COBBLESTONE });
11 | craftingmanager.registerShapedRecipe(new ItemStack(Block.WORKBENCH), new Object[] { "##", "##", Character.valueOf('#'), Block.WOOD });
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/Cancellable.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event;
2 |
3 | public interface Cancellable {
4 | /**
5 | * Gets the cancellation state of this event. A cancelled event will not
6 | * be executed in the server, but will still pass to other plugins
7 | *
8 | * @return true if this event is cancelled
9 | */
10 | public boolean isCancelled();
11 |
12 | /**
13 | * Sets the cancellation state of this event. A cancelled event will not
14 | * be executed in the server, but will still pass to other plugins.
15 | *
16 | * @param cancel true if you wish to cancel this event
17 | */
18 | public void setCancelled(boolean cancel);
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemFood.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemFood extends Item {
4 |
5 | private int a;
6 | private boolean bk;
7 |
8 | public ItemFood(int i, int j, boolean flag) {
9 | super(i);
10 | this.a = j;
11 | this.bk = flag;
12 | this.maxStackSize = 1;
13 | }
14 |
15 | public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
16 | --itemstack.count;
17 | entityhuman.b(this.a);
18 | return itemstack;
19 | }
20 |
21 | public int k() {
22 | return this.a;
23 | }
24 |
25 | public boolean l() {
26 | return this.bk;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/.github/workflows/format.yml:
--------------------------------------------------------------------------------
1 | name: IntelliJ Format
2 |
3 | on:
4 | push:
5 | branches: [ "master" ]
6 | pull_request:
7 | branches: [ "master" ]
8 |
9 | jobs:
10 | formatting:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - if: github.event_name != 'pull_request'
14 | uses: actions/checkout@v4
15 | - if: github.event_name == 'pull_request'
16 | uses: actions/checkout@v4
17 | with:
18 | ref: ${{ github.event.pull_request.head.ref }}
19 | - uses: notdevcody/intellij-format-action@v1.1
20 | with:
21 | include-glob: '*.java'
22 | path: src/main/java/
23 | style-settings-file: ../../../.idea/codeStyles/Project.xml
24 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/IWorldAccess.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public interface IWorldAccess {
4 |
5 | void a(int i, int j, int k);
6 |
7 | void a(int i, int j, int k, int l, int i1, int j1);
8 |
9 | void a(String s, double d0, double d1, double d2, float f, float f1);
10 |
11 | void a(String s, double d0, double d1, double d2, double d3, double d4, double d5);
12 |
13 | void a(Entity entity);
14 |
15 | void b(Entity entity);
16 |
17 | void a();
18 |
19 | void a(String s, int i, int j, int k);
20 |
21 | void a(int i, int j, int k, TileEntity tileentity);
22 |
23 | void a(EntityHuman entityhuman, int i, int j, int k, int l, int i1);
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import org.bukkit.craftbukkit.CraftServer;
4 | import org.bukkit.entity.Projectile;
5 |
6 | public abstract class AbstractProjectile extends CraftEntity implements Projectile {
7 |
8 | private boolean doesBounce;
9 |
10 | public AbstractProjectile(CraftServer server, net.minecraft.server.Entity entity) {
11 | super(server, entity);
12 | doesBounce = false;
13 | }
14 |
15 | public boolean doesBounce() {
16 | return doesBounce;
17 | }
18 |
19 | public void setBounce(boolean doesBounce) {
20 | this.doesBounce = doesBounce;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockLightStone.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | import uk.betacraft.uberbukkit.UberbukkitConfig;
6 |
7 | public class BlockLightStone extends Block {
8 |
9 | public BlockLightStone(int i, int j, Material material) {
10 | super(i, j, material);
11 | }
12 |
13 | public int a(Random random) {
14 | // uberbukkit
15 | if (!UberbukkitConfig.getInstance().getBoolean("mechanics.glowstone_pre1_6_6", false))
16 | return 2 + random.nextInt(3);
17 |
18 | return super.a(random);
19 | }
20 |
21 | public int a(int i, Random random) {
22 | return Item.GLOWSTONE_DUST.id;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/SlotArmor.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | class SlotArmor extends Slot {
4 |
5 | final int d;
6 |
7 | final ContainerPlayer e;
8 |
9 | SlotArmor(ContainerPlayer containerplayer, IInventory iinventory, int i, int j, int k, int l) {
10 | super(iinventory, i, j, k);
11 | this.e = containerplayer;
12 | this.d = l;
13 | }
14 |
15 | public int d() {
16 | return 1;
17 | }
18 |
19 | public boolean isAllowed(ItemStack itemstack) {
20 | return itemstack.getItem() instanceof ItemArmor ? ((ItemArmor) itemstack.getItem()).bk == this.d : (itemstack.getItem().id == Block.PUMPKIN.id ? this.d == 0 : false);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.inventory;
2 |
3 | import net.minecraft.server.Slot;
4 | import org.bukkit.inventory.Inventory;
5 | import org.bukkit.inventory.ItemStack;
6 |
7 | public class CraftSlot implements org.bukkit.inventory.Slot {
8 | private final Slot slot;
9 |
10 | public CraftSlot(Slot slot) {
11 | this.slot = slot;
12 | }
13 |
14 | public Inventory getInventory() {
15 | return new CraftInventory(slot.inventory);
16 | }
17 |
18 | public int getIndex() {
19 | return slot.index;
20 | }
21 |
22 | public ItemStack getItem() {
23 | return new CraftItemStack(slot.getItem());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.block;
2 |
3 | import org.bukkit.Location;
4 | import org.bukkit.block.Block;
5 |
6 | public class BlockPistonRetractEvent extends BlockPistonEvent {
7 | public BlockPistonRetractEvent(Block block) {
8 | super(Type.BLOCK_PISTON_RETRACT, block);
9 | }
10 |
11 | /**
12 | * Gets the location where the possible moving block might be if the retracting
13 | * piston is sticky.
14 | *
15 | * @return The possible location of the possibly moving block.
16 | */
17 | public Location getRetractLocation() {
18 | return getBlock().getRelative(getDirection(), 2).getLocation();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.block.Block;
4 | import org.bukkit.entity.Player;
5 |
6 | /**
7 | * This event is fired when the player is leaving a bed.
8 | */
9 | public class PlayerBedLeaveEvent extends PlayerEvent {
10 |
11 | private Block bed;
12 |
13 | public PlayerBedLeaveEvent(Player who, Block bed) {
14 | super(Type.PLAYER_BED_LEAVE, who);
15 | this.bed = bed;
16 | }
17 |
18 | /**
19 | * Returns the bed block involved in this event.
20 | *
21 | * @return the bed block involved in this event
22 | */
23 | public Block getBed() {
24 | return bed;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockWeb.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class BlockWeb extends Block {
6 |
7 | public BlockWeb(int i, int j) {
8 | super(i, j, Material.WEB);
9 | }
10 |
11 | public void a(World world, int i, int j, int k, Entity entity) {
12 | entity.bf = true;
13 | }
14 |
15 | public boolean a() {
16 | return false;
17 | }
18 |
19 | public AxisAlignedBB e(World world, int i, int j, int k) {
20 | return null;
21 | }
22 |
23 | public boolean b() {
24 | return false;
25 | }
26 |
27 | public int a(int i, Random random) {
28 | return Item.STRING.id;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/EntityWaterAnimal.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class EntityWaterAnimal extends EntityCreature implements IAnimal {
4 |
5 | public EntityWaterAnimal(World world) {
6 | super(world);
7 | }
8 |
9 | public boolean b_() {
10 | return true;
11 | }
12 |
13 | public void b(NBTTagCompound nbttagcompound) {
14 | super.b(nbttagcompound);
15 | }
16 |
17 | public void a(NBTTagCompound nbttagcompound) {
18 | super.a(nbttagcompound);
19 | }
20 |
21 | public boolean d() {
22 | return this.world.containsEntity(this.boundingBox);
23 | }
24 |
25 | public int e() {
26 | return 120;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/me/devcody/uberbukkit/math/Vec3.java:
--------------------------------------------------------------------------------
1 | package me.devcody.uberbukkit.math;
2 |
3 | public class Vec3 {
4 | protected T x;
5 | protected T y;
6 | protected T z;
7 |
8 | public Vec3(T x, T y, T z) {
9 | this.x = x;
10 | this.y = y;
11 | this.z = z;
12 | }
13 |
14 | public T getX() {
15 | return x;
16 | }
17 |
18 | public void setX(T x) {
19 | this.x = x;
20 | }
21 |
22 | public T getY() {
23 | return y;
24 | }
25 |
26 | public void setY(T y) {
27 | this.y = y;
28 | }
29 |
30 | public T getZ() {
31 | return z;
32 | }
33 |
34 | public void setZ(T z) {
35 | this.z = z;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WorldProviderSky.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class WorldProviderSky extends WorldProvider {
4 |
5 | public WorldProviderSky() {
6 | }
7 |
8 | public void a() {
9 | this.b = new WorldChunkManagerHell(BiomeBase.SKY, 0.5D, 0.0D);
10 | this.dimension = 1;
11 | }
12 |
13 | public IChunkProvider getChunkProvider() {
14 | return new ChunkProviderSky(this.a, this.a.getSeed());
15 | }
16 |
17 | public float a(long i, float f) {
18 | return 0.0F;
19 | }
20 |
21 | public boolean canSpawn(int i, int j) {
22 | int k = this.a.a(i, j);
23 |
24 | return k == 0 ? false : Block.byId[k].material.isSolid();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.block;
2 |
3 | import org.bukkit.block.Block;
4 | import org.bukkit.event.Cancellable;
5 |
6 | /**
7 | * Called when leaves are decaying naturally.
8 | *
9 | * If a Leaves Decay event is cancelled, the leaves will not decay.
10 | */
11 | public class LeavesDecayEvent extends BlockEvent implements Cancellable {
12 | private boolean cancel = false;
13 |
14 | public LeavesDecayEvent(final Block block) {
15 | super(Type.LEAVES_DECAY, block);
16 | }
17 |
18 | public boolean isCancelled() {
19 | return cancel;
20 | }
21 |
22 | public void setCancelled(boolean cancel) {
23 | this.cancel = cancel;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/command/CommandSender.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.command;
2 |
3 | import org.bukkit.Server;
4 | import org.bukkit.permissions.Permissible;
5 |
6 | public interface CommandSender extends Permissible {
7 |
8 | /**
9 | * Sends this sender a message
10 | *
11 | * @param message Message to be displayed
12 | */
13 | public void sendMessage(String message);
14 |
15 | /**
16 | * Returns the server instance that this command is running on
17 | *
18 | * @return Server instance
19 | */
20 | public Server getServer();
21 |
22 | /**
23 | * Gets the name of this command sender
24 | *
25 | * @return Name of the sender
26 | */
27 | public String getName();
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.entity.Player;
4 | import org.bukkit.inventory.Inventory;
5 |
6 | /**
7 | * Represents a player related inventory event
8 | */
9 | public class PlayerInventoryEvent extends PlayerEvent {
10 | protected Inventory inventory;
11 |
12 | public PlayerInventoryEvent(final Player player, final Inventory inventory) {
13 | super(Type.PLAYER_INVENTORY, player);
14 | this.inventory = inventory;
15 | }
16 |
17 | /**
18 | * Gets the Inventory involved in this event
19 | *
20 | * @return Inventory
21 | */
22 | public Inventory getInventory() {
23 | return inventory;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/block/Furnace.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.block;
2 |
3 | /**
4 | * Represents a furnace.
5 | *
6 | * @author sk89q
7 | */
8 | public interface Furnace extends BlockState, ContainerBlock {
9 |
10 | /**
11 | * Get burn time.
12 | *
13 | * @return
14 | */
15 | public short getBurnTime();
16 |
17 | /**
18 | * Set burn time.
19 | *
20 | * @param burnTime
21 | */
22 | public void setBurnTime(short burnTime);
23 |
24 | /**
25 | * Get cook time.
26 | *
27 | * @return
28 | */
29 | public short getCookTime();
30 |
31 | /**
32 | * Set cook time.
33 | *
34 | * @param cookTime
35 | */
36 | public void setCookTime(short cookTime);
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/command/MultipleCommandAlias.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.command;
2 |
3 | /**
4 | * Represents a command that delegates to one or more other commands
5 | */
6 | public class MultipleCommandAlias extends Command {
7 | private Command[] commands;
8 |
9 | public MultipleCommandAlias(String name, Command[] commands) {
10 | super(name);
11 | this.commands = commands;
12 | }
13 |
14 | @Override
15 | public boolean execute(CommandSender sender, String commandLabel, String[] args) {
16 | boolean result = false;
17 |
18 | for (Command command : commands) {
19 | result |= command.execute(sender, commandLabel, args);
20 | }
21 |
22 | return result;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityWeatherStorm;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.LightningStrike;
6 |
7 | public class CraftLightningStrike extends CraftEntity implements LightningStrike {
8 | public CraftLightningStrike(final CraftServer server, final EntityWeatherStorm entity) {
9 | super(server, entity);
10 | }
11 |
12 | @Override
13 | public EntityWeatherStorm getHandle() {
14 | return (EntityWeatherStorm) super.getHandle();
15 | }
16 |
17 | public boolean isEffect() {
18 | return ((EntityWeatherStorm) super.getHandle()).isEffect;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.plugin;
2 |
3 | /**
4 | * Thrown when a plugin attempts to interact with the server when it is not enabled
5 | */
6 | public class IllegalPluginAccessException extends RuntimeException {
7 |
8 | /**
9 | * Creates a new instance of IllegalPluginAccessException without detail message.
10 | */
11 | public IllegalPluginAccessException() {
12 | }
13 |
14 | /**
15 | * Constructs an instance of IllegalPluginAccessException with the specified detail message.
16 | *
17 | * @param msg the detail message.
18 | */
19 | public IllegalPluginAccessException(String msg) {
20 | super(msg);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/scheduler/BukkitTask.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.scheduler;
2 |
3 | import org.bukkit.plugin.Plugin;
4 |
5 | /**
6 | * Represents a task being executed by the scheduler
7 | */
8 |
9 | public interface BukkitTask {
10 |
11 | /**
12 | * Returns the taskId for the task
13 | *
14 | * @return Task id number
15 | */
16 | public int getTaskId();
17 |
18 | /**
19 | * Returns the Plugin that owns this task
20 | *
21 | * @return The Plugin that owns the task
22 | */
23 | public Plugin getOwner();
24 |
25 | /**
26 | * Returns true if the Task is a sync task
27 | *
28 | * @return true if the task is run by main thread
29 | */
30 | public boolean isSync();
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockSnowBlock.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class BlockSnowBlock extends Block {
6 |
7 | protected BlockSnowBlock(int i, int j) {
8 | super(i, j, Material.SNOW_BLOCK);
9 | this.a(true);
10 | }
11 |
12 | public int a(int i, Random random) {
13 | return Item.SNOW_BALL.id;
14 | }
15 |
16 | public int a(Random random) {
17 | return 4;
18 | }
19 |
20 | public void a(World world, int i, int j, int k, Random random) {
21 | if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11) {
22 | this.g(world, i, j, k, world.getData(i, j, k));
23 | world.setTypeId(i, j, k, 0);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ConvertProgressUpdater.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ConvertProgressUpdater implements IProgressUpdate {
4 |
5 | private long b;
6 |
7 | final MinecraftServer a;
8 |
9 | public ConvertProgressUpdater(MinecraftServer minecraftserver) {
10 | this.a = minecraftserver;
11 | this.b = System.currentTimeMillis();
12 | }
13 |
14 | public void a(String s) {
15 | }
16 |
17 | public void a(int i) {
18 | if (System.currentTimeMillis() - this.b >= 1000L) {
19 | this.b = System.currentTimeMillis();
20 | MinecraftServer.log.info("Converting... " + i + "%");
21 | }
22 | }
23 |
24 | public void b(String s) {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.vehicle;
2 |
3 | import org.bukkit.block.Block;
4 | import org.bukkit.entity.Vehicle;
5 |
6 | /**
7 | * Raised when a vehicle collides with a block.
8 | */
9 | public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
10 | private Block block;
11 |
12 | public VehicleBlockCollisionEvent(Vehicle vehicle, Block block) {
13 | super(Type.VEHICLE_COLLISION_BLOCK, vehicle);
14 | this.block = block;
15 | }
16 |
17 | /**
18 | * Gets the block the vehicle collided with
19 | *
20 | * @return the block the vehicle collided with
21 | */
22 | public Block getBlock() {
23 | return block;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagInt.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagInt extends NBTBase {
8 |
9 | public int a;
10 |
11 | public NBTTagInt() {
12 | }
13 |
14 | public NBTTagInt(int i) {
15 | this.a = i;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeInt(this.a);
20 | }
21 |
22 | void a(DataInput datainput) throws IOException {
23 | this.a = datainput.readInt();
24 | }
25 |
26 | public byte a() {
27 | return (byte) 3;
28 | }
29 |
30 | public String toString() {
31 | return "" + this.a;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.Chunk;
4 |
5 | /**
6 | * Called when a chunk is loaded
7 | */
8 | public class ChunkLoadEvent extends ChunkEvent {
9 | private final boolean newChunk;
10 |
11 | public ChunkLoadEvent(final Chunk chunk, final boolean newChunk) {
12 | super(Type.CHUNK_LOAD, chunk);
13 | this.newChunk = newChunk;
14 | }
15 |
16 | /**
17 | * Gets if this chunk was newly created or not.
18 | * Note that if this chunk is new, it will not be populated at this time.
19 | *
20 | * @return true if the chunk is new, otherwise false
21 | */
22 | public boolean isNewChunk() {
23 | return newChunk;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagByte.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagByte extends NBTBase {
8 |
9 | public byte a;
10 |
11 | public NBTTagByte() {
12 | }
13 |
14 | public NBTTagByte(byte b0) {
15 | this.a = b0;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeByte(this.a);
20 | }
21 |
22 | void a(DataInput datainput) throws IOException {
23 | this.a = datainput.readByte();
24 | }
25 |
26 | public byte a() {
27 | return (byte) 1;
28 | }
29 |
30 | public String toString() {
31 | return "" + this.a;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagLong.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagLong extends NBTBase {
8 |
9 | public long a;
10 |
11 | public NBTTagLong() {
12 | }
13 |
14 | public NBTTagLong(long i) {
15 | this.a = i;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeLong(this.a);
20 | }
21 |
22 | void a(DataInput datainput) throws IOException {
23 | this.a = datainput.readLong();
24 | }
25 |
26 | public byte a() {
27 | return (byte) 4;
28 | }
29 |
30 | public String toString() {
31 | return "" + this.a;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagFloat.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagFloat extends NBTBase {
8 |
9 | public float a;
10 |
11 | public NBTTagFloat() {
12 | }
13 |
14 | public NBTTagFloat(float f) {
15 | this.a = f;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeFloat(this.a);
20 | }
21 |
22 | void a(DataInput datainput) throws IOException {
23 | this.a = datainput.readFloat();
24 | }
25 |
26 | public byte a() {
27 | return (byte) 5;
28 | }
29 |
30 | public String toString() {
31 | return "" + this.a;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ServerGuiCommandListener.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import javax.swing.*;
4 | import java.awt.event.ActionEvent;
5 | import java.awt.event.ActionListener;
6 |
7 | class ServerGuiCommandListener implements ActionListener {
8 |
9 | final JTextField a;
10 |
11 | final ServerGUI b;
12 |
13 | ServerGuiCommandListener(ServerGUI servergui, JTextField jtextfield) {
14 | this.b = servergui;
15 | this.a = jtextfield;
16 | }
17 |
18 | public void actionPerformed(ActionEvent actionevent) {
19 | String s = this.a.getText().trim();
20 |
21 | if (s.length() > 0) {
22 | ServerGUI.a(this.b).issueCommand(s, this.b);
23 | }
24 |
25 | this.a.setText("");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/me/devcody/uberbukkit/patch/impl/HeadRotationPatch.java:
--------------------------------------------------------------------------------
1 | package me.devcody.uberbukkit.patch.impl;
2 |
3 | import me.devcody.uberbukkit.patch.Patch;
4 | import net.minecraft.server.EntityPlayer;
5 |
6 | public class HeadRotationPatch extends Patch {
7 | public HeadRotationPatch() {
8 | super("head-rotation");
9 | }
10 |
11 | @Override
12 | protected boolean validate(EntityPlayer player, Object... data) {
13 | if (data.length < 2) return true;
14 |
15 | if (!(data[0] instanceof Float && data[1] instanceof Float)) return true;
16 |
17 | float yaw = (float) data[0];
18 | float pitch = (float) data[1];
19 |
20 | return (pitch >= -90 && pitch <= 90)
21 | && (yaw >= -180 && yaw <= 180);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ChunkFileFilter.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.File;
4 | import java.io.FileFilter;
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | class ChunkFileFilter implements FileFilter {
9 |
10 | public static final Pattern a = Pattern.compile("[0-9a-z]|([0-9a-z][0-9a-z])");
11 |
12 | private ChunkFileFilter() {
13 | }
14 |
15 | public boolean accept(File file1) {
16 | if (file1.isDirectory()) {
17 | Matcher matcher = a.matcher(file1.getName());
18 |
19 | return matcher.matches();
20 | } else {
21 | return false;
22 | }
23 | }
24 |
25 | ChunkFileFilter(EmptyClass2 emptyclass2) {
26 | this();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 | import org.bukkit.entity.Entity;
4 | import org.bukkit.event.Cancellable;
5 |
6 | /**
7 | * Called when an entity combusts due to the sun.
8 | *
9 | * If an Entity Combust event is cancelled, the entity will not combust.
10 | */
11 | public class EntityCombustEvent extends EntityEvent implements Cancellable {
12 | private boolean cancel;
13 |
14 | public EntityCombustEvent(Entity what) {
15 | super(Type.ENTITY_COMBUST, what);
16 | this.cancel = false;
17 | }
18 |
19 | public boolean isCancelled() {
20 | return cancel;
21 | }
22 |
23 | public void setCancelled(boolean cancel) {
24 | this.cancel = cancel;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 |
4 | import org.bukkit.Location;
5 | import org.bukkit.entity.Entity;
6 |
7 | /**
8 | * Stores data for entities standing inside a portal block
9 | */
10 | public class EntityPortalEnterEvent extends EntityEvent {
11 |
12 | private Location location;
13 |
14 | public EntityPortalEnterEvent(Entity entity, Location location) {
15 | super(Type.ENTITY_PORTAL_ENTER, entity);
16 | this.location = location;
17 | }
18 |
19 | /**
20 | * Gets the portal block the entity is touching
21 | *
22 | * @return The portal block the entity is touching
23 | */
24 | public Location getLocation() {
25 | return location;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ChunkCoordIntPair.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ChunkCoordIntPair {
4 |
5 | public final int x;
6 | public final int z;
7 |
8 | public ChunkCoordIntPair(int i, int j) {
9 | this.x = i;
10 | this.z = j;
11 | }
12 |
13 | public static int a(int i, int j) {
14 | return (i < 0 ? Integer.MIN_VALUE : 0) | (i & 32767) << 16 | (j < 0 ? '\u8000' : 0) | j & 32767;
15 | }
16 |
17 | public int hashCode() {
18 | return a(this.x, this.z);
19 | }
20 |
21 | public boolean equals(Object object) {
22 | ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) object;
23 |
24 | return chunkcoordintpair.x == this.x && chunkcoordintpair.z == this.z;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagDouble.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagDouble extends NBTBase {
8 |
9 | public double a;
10 |
11 | public NBTTagDouble() {
12 | }
13 |
14 | public NBTTagDouble(double d0) {
15 | this.a = d0;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeDouble(this.a);
20 | }
21 |
22 | void a(DataInput datainput) throws IOException {
23 | this.a = datainput.readDouble();
24 | }
25 |
26 | public byte a() {
27 | return (byte) 6;
28 | }
29 |
30 | public String toString() {
31 | return "" + this.a;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagShort.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagShort extends NBTBase {
8 |
9 | public short a;
10 |
11 | public NBTTagShort() {
12 | }
13 |
14 | public NBTTagShort(short short1) {
15 | this.a = short1;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeShort(this.a);
20 | }
21 |
22 | void a(DataInput datainput) throws IOException {
23 | this.a = datainput.readShort();
24 | }
25 |
26 | public byte a() {
27 | return (byte) 2;
28 | }
29 |
30 | public String toString() {
31 | return "" + this.a;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/command/CommandException.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.command;
2 |
3 | /**
4 | * Thrown when an unhandled exception occurs during the execution of a Command
5 | */
6 | public class CommandException extends RuntimeException {
7 |
8 | /**
9 | * Creates a new instance of CommandException without detail message.
10 | */
11 | public CommandException() {
12 | }
13 |
14 | /**
15 | * Constructs an instance of CommandException with the specified detail message.
16 | *
17 | * @param msg the detail message.
18 | */
19 | public CommandException(String msg) {
20 | super(msg);
21 | }
22 |
23 | public CommandException(String msg, Throwable cause) {
24 | super(msg, cause);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 | import org.bukkit.entity.Entity;
4 | import org.bukkit.inventory.ItemStack;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Thrown whenever a LivingEntity dies
10 | */
11 | public class EntityDeathEvent extends EntityEvent {
12 | private List drops;
13 |
14 | public EntityDeathEvent(final Entity what, final List drops) {
15 | super(Type.ENTITY_DEATH, what);
16 | this.drops = drops;
17 | }
18 |
19 | /**
20 | * Gets all the items which will drop when the entity dies
21 | *
22 | * @return Items to drop when the entity dies
23 | */
24 | public List getDrops() {
25 | return drops;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.painting;
2 |
3 | import org.bukkit.entity.Entity;
4 | import org.bukkit.entity.Painting;
5 |
6 | /**
7 | * Triggered when a painting is removed by an entity
8 | */
9 | public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
10 | private Entity remover;
11 |
12 | public PaintingBreakByEntityEvent(final Painting painting, final Entity remover) {
13 | super(painting, RemoveCause.ENTITY);
14 | this.remover = remover;
15 | }
16 |
17 | /**
18 | * Gets the entity that removed the painting
19 | *
20 | * @return the entity that removed the painting.
21 | */
22 | public Entity getRemover() {
23 | return remover;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/RecipeSorter.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Comparator;
4 |
5 | class RecipeSorter implements Comparator {
6 |
7 | final CraftingManager a;
8 |
9 | RecipeSorter(CraftingManager craftingmanager) {
10 | this.a = craftingmanager;
11 | }
12 |
13 | public int compare(Object o1, Object o2) {
14 | CraftingRecipe craftingrecipe = (CraftingRecipe) o1, craftingrecipe1 = (CraftingRecipe) o2;
15 | return craftingrecipe instanceof ShapelessRecipes && craftingrecipe1 instanceof ShapedRecipes ? 1 : (craftingrecipe1 instanceof ShapelessRecipes && craftingrecipe instanceof ShapedRecipes ? -1 : (craftingrecipe1.a() < craftingrecipe.a() ? -1 : (craftingrecipe1.a() > craftingrecipe.a() ? 1 : 0)));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol8.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol8 extends Protocol9 {
4 |
5 | @Override
6 | public boolean canReceiveBlockItem(int id) {
7 | switch (id) {
8 | case 355: // bed
9 | case 356: // redstone repeater
10 | return false;
11 | default:
12 | return super.canReceiveBlockItem(id);
13 | }
14 | }
15 |
16 | @Override
17 | public boolean canReceivePacket(int id) {
18 | switch (id) {
19 | case 17: // bed error
20 | case 27: // sneak
21 | return false;
22 | default:
23 | return super.canReceivePacket(id);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BiomeTaiga.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | import uk.betacraft.uberbukkit.UberbukkitConfig;
6 |
7 | public class BiomeTaiga extends BiomeBase {
8 |
9 | public BiomeTaiga() {
10 | // uberbukkit
11 | if (UberbukkitConfig.getInstance().getBoolean("mechanics.spawn_wolves", true))
12 | this.t.add(new BiomeMeta(EntityWolf.class, 2));
13 | }
14 |
15 | public WorldGenerator a(Random random) {
16 | // uberbukkit
17 | if (!UberbukkitConfig.getInstance().getBoolean("worldgen.biomes.generate_spruces", true))
18 | return super.a(random);
19 |
20 | return (WorldGenerator) (random.nextInt(3) == 0 ? new WorldGenTaiga1() : new WorldGenTaiga2());
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemSaddle.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemSaddle extends Item {
4 |
5 | public ItemSaddle(int i) {
6 | super(i);
7 | this.maxStackSize = 1;
8 | }
9 |
10 | public void a(ItemStack itemstack, EntityLiving entityliving) {
11 | if (entityliving instanceof EntityPig) {
12 | EntityPig entitypig = (EntityPig) entityliving;
13 |
14 | if (!entitypig.hasSaddle()) {
15 | entitypig.setSaddle(true);
16 | --itemstack.count;
17 | }
18 | }
19 | }
20 |
21 | public boolean a(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) {
22 | this.a(itemstack, entityliving);
23 | return true;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ServerWindowAdapter.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.awt.event.WindowAdapter;
4 | import java.awt.event.WindowEvent;
5 |
6 | final class ServerWindowAdapter extends WindowAdapter {
7 |
8 | final MinecraftServer a;
9 |
10 | ServerWindowAdapter(MinecraftServer minecraftserver) {
11 | this.a = minecraftserver;
12 | }
13 |
14 | public void windowClosing(WindowEvent windowevent) {
15 | this.a.a();
16 |
17 | while (!this.a.isStopped) {
18 | try {
19 | Thread.sleep(100L);
20 | } catch (InterruptedException interruptedexception) {
21 | interruptedexception.printStackTrace();
22 | }
23 | }
24 |
25 | System.exit(0);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WorldGenFire.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class WorldGenFire extends WorldGenerator {
6 |
7 | public WorldGenFire() {
8 | }
9 |
10 | public boolean a(World world, Random random, int i, int j, int k) {
11 | for (int l = 0; l < 64; ++l) {
12 | int i1 = i + random.nextInt(8) - random.nextInt(8);
13 | int j1 = j + random.nextInt(4) - random.nextInt(4);
14 | int k1 = k + random.nextInt(8) - random.nextInt(8);
15 |
16 | if (world.isEmpty(i1, j1, k1) && world.getTypeId(i1, j1 - 1, k1) == Block.NETHERRACK.id) {
17 | world.setTypeId(i1, j1, k1, Block.FIRE.id);
18 | }
19 | }
20 |
21 | return true;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/block/PistonMoveReaction.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.block;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | public enum PistonMoveReaction {
7 | MOVE(0), BREAK(1), BLOCK(2);
8 |
9 | private int id;
10 | private static Map byId = new HashMap();
11 |
12 | static {
13 | for (PistonMoveReaction reaction : PistonMoveReaction.values()) {
14 | byId.put(reaction.id, reaction);
15 | }
16 | }
17 |
18 | private PistonMoveReaction(int id) {
19 | this.id = id;
20 | }
21 |
22 | public int getId() {
23 | return this.id;
24 | }
25 |
26 | public static PistonMoveReaction getById(int id) {
27 | return byId.get(id);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockContainer.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public abstract class BlockContainer extends Block {
4 |
5 | protected BlockContainer(int i, Material material) {
6 | super(i, material);
7 | isTileEntity[i] = true;
8 | }
9 |
10 | protected BlockContainer(int i, int j, Material material) {
11 | super(i, j, material);
12 | isTileEntity[i] = true;
13 | }
14 |
15 | public void c(World world, int i, int j, int k) {
16 | super.c(world, i, j, k);
17 | world.setTileEntity(i, j, k, this.a_());
18 | }
19 |
20 | public void remove(World world, int i, int j, int k) {
21 | super.remove(world, i, j, k);
22 | world.o(i, j, k);
23 | }
24 |
25 | protected abstract TileEntity a_();
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.world;
2 |
3 | import org.bukkit.Location;
4 | import org.bukkit.World;
5 |
6 | /**
7 | * An event that is called when a world's spawn changes. The
8 | * world's previous spawn location is included.
9 | */
10 | public class SpawnChangeEvent extends WorldEvent {
11 | private Location previousLocation;
12 |
13 | public SpawnChangeEvent(World world, Location previousLocation) {
14 | super(Type.SPAWN_CHANGE, world);
15 | this.previousLocation = previousLocation;
16 | }
17 |
18 | /**
19 | * Gets the previous spawn location
20 | *
21 | * @return Location that used to be spawn
22 | */
23 | public Location getPreviousLocation() {
24 | return previousLocation;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityBoat;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Boat;
6 |
7 | public class CraftBoat extends CraftVehicle implements Boat {
8 | protected EntityBoat boat;
9 |
10 | public CraftBoat(CraftServer server, EntityBoat entity) {
11 | super(server, entity);
12 | boat = entity;
13 | }
14 |
15 | public double getMaxSpeed() {
16 | return boat.maxSpeed;
17 | }
18 |
19 | public void setMaxSpeed(double speed) {
20 | if (speed >= 0D) {
21 | boat.maxSpeed = speed;
22 | }
23 | }
24 |
25 | @Override
26 | public String toString() {
27 | return "CraftBoat";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftPig.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityPig;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Pig;
6 |
7 | public class CraftPig extends CraftAnimals implements Pig {
8 | public CraftPig(CraftServer server, EntityPig entity) {
9 | super(server, entity);
10 | }
11 |
12 | public boolean hasSaddle() {
13 | return getHandle().hasSaddle();
14 | }
15 |
16 | public void setSaddle(boolean saddled) {
17 | getHandle().setSaddle(saddled);
18 | }
19 |
20 | public EntityPig getHandle() {
21 | return (EntityPig) super.getHandle();
22 | }
23 |
24 | @Override
25 | public String toString() {
26 | return "CraftPig";
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntitySlime;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.entity.Slime;
6 |
7 | public class CraftSlime extends CraftLivingEntity implements Slime {
8 |
9 | public CraftSlime(CraftServer server, EntitySlime entity) {
10 | super(server, entity);
11 | }
12 |
13 | @Override
14 | public String toString() {
15 | return "CraftSlime";
16 | }
17 |
18 | public EntitySlime getHandle() {
19 | return (EntitySlime) super.getHandle();
20 | }
21 |
22 | public int getSize() {
23 | return getHandle().getSize();
24 | }
25 |
26 | public void setSize(int size) {
27 | getHandle().setSize(size);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockRegister.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class BlockRegister {
4 |
5 | private static byte[] a = new byte[256];
6 |
7 | public BlockRegister() {
8 | }
9 |
10 | public static void a(byte[] abyte) {
11 | for (int i = 0; i < abyte.length; ++i) {
12 | abyte[i] = a[abyte[i] & 255];
13 | }
14 | }
15 |
16 | static {
17 | try {
18 | for (int i = 0; i < 256; ++i) {
19 | byte b0 = (byte) i;
20 |
21 | if (b0 != 0 && Block.byId[b0 & 255] == null) {
22 | b0 = 0;
23 | }
24 |
25 | a[i] = b0;
26 | }
27 | } catch (Exception exception) {
28 | exception.printStackTrace();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ChunkPosition.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ChunkPosition {
4 |
5 | public final int x;
6 | public final int y;
7 | public final int z;
8 |
9 | public ChunkPosition(int i, int j, int k) {
10 | this.x = i;
11 | this.y = j;
12 | this.z = k;
13 | }
14 |
15 | public boolean equals(Object object) {
16 | if (!(object instanceof ChunkPosition)) {
17 | return false;
18 | } else {
19 | ChunkPosition chunkposition = (ChunkPosition) object;
20 |
21 | return chunkposition.x == this.x && chunkposition.y == this.y && chunkposition.z == this.z;
22 | }
23 | }
24 |
25 | public int hashCode() {
26 | return this.x * 8976890 + this.y * 981131 + this.z;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/block/BlockBurnEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.block;
2 |
3 | import org.bukkit.block.Block;
4 | import org.bukkit.event.Cancellable;
5 |
6 | /**
7 | * Called when a block is destroyed as a result of being burnt by fire.
8 | *
9 | * If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
10 | */
11 | public class BlockBurnEvent extends BlockEvent implements Cancellable {
12 | private boolean cancelled;
13 |
14 | public BlockBurnEvent(Block block) {
15 | super(Type.BLOCK_BURN, block);
16 | this.cancelled = false;
17 | }
18 |
19 | public boolean isCancelled() {
20 | return cancelled;
21 | }
22 |
23 | public void setCancelled(boolean cancel) {
24 | this.cancelled = cancel;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/SlotResult2.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class SlotResult2 extends Slot {
4 |
5 | private EntityHuman d;
6 |
7 | public SlotResult2(EntityHuman entityhuman, IInventory iinventory, int i, int j, int k) {
8 | super(iinventory, i, j, k);
9 | this.d = entityhuman;
10 | }
11 |
12 | public boolean isAllowed(ItemStack itemstack) {
13 | return false;
14 | }
15 |
16 | public void a(ItemStack itemstack) {
17 | itemstack.b(this.d.world, this.d);
18 | if (itemstack.id == Item.IRON_INGOT.id) {
19 | this.d.a(AchievementList.k, 1);
20 | }
21 |
22 | if (itemstack.id == Item.COOKED_FISH.id) {
23 | this.d.a(AchievementList.p, 1);
24 | }
25 |
26 | super.a(itemstack);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 | import org.bukkit.entity.Entity;
4 | import org.bukkit.event.Cancellable;
5 |
6 | /**
7 | * Called when an entity is damaged by an entity
8 | */
9 | public class EntityDamageByEntityEvent extends EntityDamageEvent implements Cancellable {
10 |
11 | private Entity damager;
12 |
13 | public EntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage) {
14 | super(Type.ENTITY_DAMAGE, damagee, cause, damage);
15 | this.damager = damager;
16 | }
17 |
18 | /**
19 | * Returns the entity that damaged the defender.
20 | *
21 | * @return Entity that damaged the defender.
22 | */
23 | public Entity getDamager() {
24 | return damager;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol10.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol10 extends Protocol11 {
4 |
5 | @Override
6 | public boolean canReceiveBlockItem(int id) {
7 | switch (id) {
8 | case 30: // cobweb
9 | case 27: // powered rails
10 | case 28: // detector rails
11 | return false;
12 | default:
13 | return super.canReceiveBlockItem(id);
14 | }
15 | }
16 |
17 | @Override
18 | public boolean canReceivePacket(int id) {
19 | switch (id) {
20 | case 200: // statistics
21 | case 71: // weather
22 | return false;
23 | default:
24 | return super.canReceivePacket(id);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/Creature.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents a Creature. Creatures are non-intelligent monsters or animals which
5 | * have very simple abilities.
6 | */
7 | public interface Creature extends LivingEntity {
8 |
9 | /**
10 | * Instructs this Creature to set the specified LivingEntity as its target.
11 | * Hostile creatures may attack their target, and friendly creatures may
12 | * follow their target.
13 | *
14 | * @param target New LivingEntity to target, or null to clear the target
15 | */
16 | public void setTarget(LivingEntity target);
17 |
18 | /**
19 | * Gets the current target of this Creature
20 | *
21 | * @return Current target of this creature, or null if none exists
22 | */
23 | public LivingEntity getTarget();
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 | import org.bukkit.block.Block;
4 | import org.bukkit.entity.Entity;
5 | import org.bukkit.event.Cancellable;
6 |
7 | /**
8 | * Called when an entity is damaged by a block
9 | */
10 | public class EntityDamageByBlockEvent extends EntityDamageEvent implements Cancellable {
11 |
12 | private Block damager;
13 |
14 | public EntityDamageByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage) {
15 | super(Type.ENTITY_DAMAGE, damagee, cause, damage);
16 | this.damager = damager;
17 | }
18 |
19 | /**
20 | * Returns the block that damaged the player.
21 | *
22 | * @return Block that damaged the player
23 | */
24 | public Block getDamager() {
25 | return damager;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet4UpdateTime.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 |
7 | public class Packet4UpdateTime extends Packet {
8 |
9 | public long a;
10 |
11 | public Packet4UpdateTime() {
12 | }
13 |
14 | public Packet4UpdateTime(long i) {
15 | this.a = i;
16 | }
17 |
18 | public void a(DataInputStream datainputstream) throws IOException {
19 | this.a = datainputstream.readLong();
20 | }
21 |
22 | public void a(DataOutputStream dataoutputstream) throws IOException {
23 | dataoutputstream.writeLong(this.a);
24 | }
25 |
26 | public void a(NetHandler nethandler) {
27 | nethandler.a(this);
28 | }
29 |
30 | public int a() {
31 | return 8;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/util/Java15Compat.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.util;
2 |
3 | import java.lang.reflect.Array;
4 |
5 | public class Java15Compat {
6 | @SuppressWarnings("unchecked")
7 | public static T[] Arrays_copyOfRange(T[] original, int start, int end) {
8 | if (original.length >= start && 0 <= start) {
9 | if (start <= end) {
10 | int length = end - start;
11 | int copyLength = Math.min(length, original.length - start);
12 | T[] copy = (T[]) Array.newInstance(original.getClass().getComponentType(), length);
13 |
14 | System.arraycopy(original, start, copy, 0, copyLength);
15 | return copy;
16 | }
17 | throw new IllegalArgumentException();
18 | }
19 | throw new ArrayIndexOutOfBoundsException();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/MovingObjectPosition.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class MovingObjectPosition {
4 |
5 | public EnumMovingObjectType type;
6 | public int b;
7 | public int c;
8 | public int d;
9 | public int face;
10 | public Vec3D f;
11 | public Entity entity;
12 |
13 | public MovingObjectPosition(int i, int j, int k, int l, Vec3D vec3d) {
14 | this.type = EnumMovingObjectType.TILE;
15 | this.b = i;
16 | this.c = j;
17 | this.d = k;
18 | this.face = l;
19 | this.f = Vec3D.create(vec3d.a, vec3d.b, vec3d.c);
20 | }
21 |
22 | public MovingObjectPosition(Entity entity) {
23 | this.type = EnumMovingObjectType.ENTITY;
24 | this.entity = entity;
25 | this.f = Vec3D.create(entity.locX, entity.locY, entity.locZ);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WorldGenFlowers.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class WorldGenFlowers extends WorldGenerator {
6 |
7 | private int a;
8 |
9 | public WorldGenFlowers(int i) {
10 | this.a = i;
11 | }
12 |
13 | public boolean a(World world, Random random, int i, int j, int k) {
14 | for (int l = 0; l < 64; ++l) {
15 | int i1 = i + random.nextInt(8) - random.nextInt(8);
16 | int j1 = j + random.nextInt(4) - random.nextInt(4);
17 | int k1 = k + random.nextInt(8) - random.nextInt(8);
18 |
19 | if (world.isEmpty(i1, j1, k1) && ((BlockFlower) Block.byId[this.a]).f(world, i1, j1, k1)) {
20 | world.setRawTypeId(i1, j1, k1, this.a);
21 | }
22 | }
23 |
24 | return true;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockBloodStone.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import org.bukkit.event.block.BlockRedstoneEvent;
4 |
5 | public class BlockBloodStone extends Block {
6 |
7 | public BlockBloodStone(int i, int j) {
8 | super(i, j, Material.STONE);
9 | }
10 |
11 | // CraftBukkit start
12 | public void doPhysics(World world, int i, int j, int k, int l) {
13 | if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].isPowerSource()) {
14 | org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
15 | int power = block.getBlockPower();
16 |
17 | BlockRedstoneEvent event = new BlockRedstoneEvent(block, power, power);
18 | world.getServer().getPluginManager().callEvent(event);
19 | }
20 | }
21 | // CraftBukkit end
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemSpade.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import uk.betacraft.uberbukkit.Uberbukkit;
4 |
5 | public class ItemSpade extends ItemTool {
6 |
7 | private static Block[] bk;
8 |
9 | public ItemSpade(int i, EnumToolMaterial enumtoolmaterial) {
10 | super(i, 1, enumtoolmaterial, bk);
11 | }
12 |
13 | public boolean a(Block block) {
14 | return block == Block.SNOW ? true : block == Block.SNOW_BLOCK;
15 | }
16 |
17 | static {
18 | if (Uberbukkit.getTargetPVN() < 12) {
19 | bk = new Block[] { Block.GRASS, Block.DIRT, Block.SAND, Block.GRAVEL, Block.SNOW, Block.SNOW_BLOCK, Block.CLAY };
20 | } else {
21 | bk = new Block[] { Block.GRASS, Block.DIRT, Block.SAND, Block.GRAVEL, Block.SNOW, Block.SNOW_BLOCK, Block.CLAY, Block.SOIL };
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet101CloseWindow.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 |
7 | public class Packet101CloseWindow extends Packet {
8 |
9 | public int a;
10 |
11 | public Packet101CloseWindow() {
12 | }
13 |
14 | public Packet101CloseWindow(int i) {
15 | this.a = i;
16 | }
17 |
18 | public void a(NetHandler nethandler) {
19 | nethandler.a(this);
20 | }
21 |
22 | public void a(DataInputStream datainputstream) throws IOException {
23 | this.a = datainputstream.readByte();
24 | }
25 |
26 | public void a(DataOutputStream dataoutputstream) throws IOException {
27 | dataoutputstream.writeByte(this.a);
28 | }
29 |
30 | public int a() {
31 | return 1;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/material/Dispenser.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.material;
2 |
3 | import org.bukkit.Material;
4 | import org.bukkit.block.BlockFace;
5 |
6 | /**
7 | * Represents a dispenser.
8 | */
9 | public class Dispenser extends FurnaceAndDispenser {
10 |
11 | public Dispenser() {
12 | super(Material.DISPENSER);
13 | }
14 |
15 | public Dispenser(BlockFace direction) {
16 | this();
17 | setFacingDirection(direction);
18 | }
19 |
20 | public Dispenser(final int type) {
21 | super(type);
22 | }
23 |
24 | public Dispenser(final Material type) {
25 | super(type);
26 | }
27 |
28 | public Dispenser(final int type, final byte data) {
29 | super(type, data);
30 | }
31 |
32 | public Dispenser(final Material type, final byte data) {
33 | super(type, data);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet29DestroyEntity.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 |
7 | public class Packet29DestroyEntity extends Packet {
8 |
9 | public int a;
10 |
11 | public Packet29DestroyEntity() {
12 | }
13 |
14 | public Packet29DestroyEntity(int i) {
15 | this.a = i;
16 | }
17 |
18 | public void a(DataInputStream datainputstream) throws IOException {
19 | this.a = datainputstream.readInt();
20 | }
21 |
22 | public void a(DataOutputStream dataoutputstream) throws IOException {
23 | dataoutputstream.writeInt(this.a);
24 | }
25 |
26 | public void a(NetHandler nethandler) {
27 | nethandler.a(this);
28 | }
29 |
30 | public int a() {
31 | return 4;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WatchableObject.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class WatchableObject {
4 |
5 | private final int a;
6 | private final int b;
7 | private Object c;
8 | private boolean d;
9 |
10 | public WatchableObject(int i, int j, Object object) {
11 | this.b = j;
12 | this.c = object;
13 | this.a = i;
14 | this.d = true;
15 | }
16 |
17 | public int a() {
18 | return this.b;
19 | }
20 |
21 | public void a(Object object) {
22 | this.c = object;
23 | }
24 |
25 | public Object b() {
26 | return this.c;
27 | }
28 |
29 | public int c() {
30 | return this.a;
31 | }
32 |
33 | public boolean d() {
34 | return this.d;
35 | }
36 |
37 | public void a(boolean flag) {
38 | this.d = flag;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/protocol/Protocol11.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.protocol;
2 |
3 | public class Protocol11 extends Protocol12 {
4 |
5 | @Override
6 | public boolean canReceiveBlockItem(int id) {
7 | switch (id) {
8 | case 31: // tallgrass
9 | case 32: // dead bush
10 | case 358: // map
11 | case 96: // trapdoor
12 | return false;
13 | default:
14 | return super.canReceiveBlockItem(id);
15 | }
16 | }
17 |
18 | @Override
19 | public boolean canReceivePacket(int id) {
20 | switch (id) {
21 | case 61: // jukebox and effects
22 | case 131: // map packet
23 | return false;
24 | default:
25 | return super.canReceivePacket(id);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/PlayerListBox.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import javax.swing.*;
4 | import java.util.Vector;
5 |
6 | public class PlayerListBox extends JList implements IUpdatePlayerListBox {
7 |
8 | private MinecraftServer a;
9 | private int b = 0;
10 |
11 | public PlayerListBox(MinecraftServer minecraftserver) {
12 | this.a = minecraftserver;
13 | minecraftserver.a((IUpdatePlayerListBox) this);
14 | }
15 |
16 | public void a() {
17 | if (this.b++ % 20 == 0) {
18 | Vector vector = new Vector();
19 |
20 | for (int i = 0; i < this.a.serverConfigurationManager.players.size(); ++i) {
21 | vector.add(((EntityPlayer) this.a.serverConfigurationManager.players.get(i)).name);
22 | }
23 |
24 | this.setListData(vector);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/WorldGenPumpkin.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class WorldGenPumpkin extends WorldGenerator {
6 |
7 | public WorldGenPumpkin() {
8 | }
9 |
10 | public boolean a(World world, Random random, int i, int j, int k) {
11 | for (int l = 0; l < 64; ++l) {
12 | int i1 = i + random.nextInt(8) - random.nextInt(8);
13 | int j1 = j + random.nextInt(4) - random.nextInt(4);
14 | int k1 = k + random.nextInt(8) - random.nextInt(8);
15 |
16 | if (world.isEmpty(i1, j1, k1) && world.getTypeId(i1, j1 - 1, k1) == Block.GRASS.id && Block.PUMPKIN.canPlace(world, i1, j1, k1)) {
17 | world.setRawTypeIdAndData(i1, j1, k1, Block.PUMPKIN.id, random.nextInt(4));
18 | }
19 | }
20 |
21 | return true;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemShears.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemShears extends Item {
4 |
5 | public ItemShears(int i) {
6 | super(i);
7 | this.c(1);
8 | this.d(238);
9 | }
10 |
11 | public boolean a(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) {
12 | if (i == Block.LEAVES.id || i == Block.WEB.id) {
13 | itemstack.damage(1, entityliving);
14 | }
15 |
16 | return super.a(itemstack, i, j, k, l, entityliving);
17 | }
18 |
19 | public boolean a(Block block) {
20 | return block.id == Block.WEB.id;
21 | }
22 |
23 | public float a(ItemStack itemstack, Block block) {
24 | return block.id != Block.WEB.id && block.id != Block.LEAVES.id ? (block.id == Block.WOOL.id ? 5.0F : super.a(itemstack, block)) : 15.0F;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet12PlayerLook.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 |
7 | public class Packet12PlayerLook extends Packet10Flying {
8 |
9 | public Packet12PlayerLook() {
10 | this.hasLook = true;
11 | }
12 |
13 | public void a(DataInputStream datainputstream) throws IOException {
14 | this.yaw = datainputstream.readFloat();
15 | this.pitch = datainputstream.readFloat();
16 | super.a(datainputstream);
17 | }
18 |
19 | public void a(DataOutputStream dataoutputstream) throws IOException {
20 | dataoutputstream.writeFloat(this.yaw);
21 | dataoutputstream.writeFloat(this.pitch);
22 | super.a(dataoutputstream);
23 | }
24 |
25 | public int a() {
26 | return 9;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BiomeForest.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | import uk.betacraft.uberbukkit.UberbukkitConfig;
6 |
7 | public class BiomeForest extends BiomeBase {
8 |
9 | public BiomeForest() {
10 | // uberbukkit
11 | if (UberbukkitConfig.getInstance().getBoolean("mechanics.spawn_wolves", true))
12 | this.t.add(new BiomeMeta(EntityWolf.class, 2));
13 | }
14 |
15 | public WorldGenerator a(Random random) {
16 | // uberbukkit
17 | if (UberbukkitConfig.getInstance().getBoolean("worldgen.biomes.generate_birches", true) && random.nextInt(5) == 0) {
18 | return new WorldGenForest();
19 | } else if (random.nextInt(3) == 0) {
20 | return new WorldGenBigTree();
21 | } else {
22 | return new WorldGenTrees();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/uk/betacraft/uberbukkit/alpha/inventory/InventoryItem.java:
--------------------------------------------------------------------------------
1 | package uk.betacraft.uberbukkit.alpha.inventory;
2 |
3 | public class InventoryItem {
4 | private int id;
5 | private int damage;
6 | protected long hash; // just to have some differentiation between duplicate queue entries (it's not perfect)
7 |
8 | public InventoryItem(int id, int damage) {
9 | this.id = id;
10 | this.damage = damage;
11 | this.hash = System.nanoTime();
12 | }
13 |
14 | public int getId() {
15 | return this.id;
16 | }
17 |
18 | public int getDamage() {
19 | return this.damage;
20 | }
21 |
22 | public int getCount() {
23 | return 1; // it's always 1, as we don't queue itemstacks, we queue individual items from the itemstack
24 | }
25 |
26 | public long getHash() {
27 | return this.hash;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/com/legacyminecraft/poseidon/util/UUIDResult.java:
--------------------------------------------------------------------------------
1 | package com.legacyminecraft.poseidon.util;
2 |
3 | import java.util.UUID;
4 |
5 | public class UUIDResult {
6 | private final UUID uuid;
7 | private final ReturnType returnType;
8 | private Exception exception;
9 |
10 | public UUIDResult(UUID uuid, ReturnType returnType) {
11 | this.uuid = uuid;
12 | this.returnType = returnType;
13 | }
14 |
15 | public UUID getUuid() {
16 | return uuid;
17 | }
18 |
19 | public ReturnType getReturnType() {
20 | return returnType;
21 | }
22 |
23 | public Exception getException() {
24 | return exception;
25 | }
26 |
27 | public void setException(Exception exception) {
28 | this.exception = exception;
29 | }
30 |
31 |
32 | public enum ReturnType {
33 | ONLINE, OFFLINE, API_OFFLINE
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/BlockWorkbench.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class BlockWorkbench extends Block {
4 |
5 | protected BlockWorkbench(int i) {
6 | super(i, Material.WOOD);
7 | this.textureId = 59;
8 | }
9 |
10 | public int a(int i) {
11 | return i == 1 ? this.textureId - 16 : (i == 0 ? Block.WOOD.a(0) : (i != 2 && i != 4 ? this.textureId : this.textureId + 1));
12 | }
13 |
14 | public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
15 | if (world.isStatic) {
16 | return true;
17 | } else {
18 | // uberbukkit
19 | if (entityhuman instanceof EntityPlayer) {
20 | ((EntityPlayer) entityhuman).isInWorkbench = true;
21 | }
22 |
23 | entityhuman.b(i, j, k);
24 | return true;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagString.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagString extends NBTBase {
8 |
9 | public String a;
10 |
11 | public NBTTagString() {
12 | }
13 |
14 | public NBTTagString(String s) {
15 | this.a = s;
16 | if (s == null) {
17 | throw new IllegalArgumentException("Empty string not allowed");
18 | }
19 | }
20 |
21 | void a(DataOutput dataoutput) throws IOException {
22 | dataoutput.writeUTF(this.a);
23 | }
24 |
25 | void a(DataInput datainput) throws IOException {
26 | this.a = datainput.readUTF();
27 | }
28 |
29 | public byte a() {
30 | return (byte) 8;
31 | }
32 |
33 | public String toString() {
34 | return "" + this.a;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/entity/CraftStorageMinecart.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.craftbukkit.entity;
2 |
3 | import net.minecraft.server.EntityMinecart;
4 | import org.bukkit.craftbukkit.CraftServer;
5 | import org.bukkit.craftbukkit.inventory.CraftInventory;
6 | import org.bukkit.entity.StorageMinecart;
7 | import org.bukkit.inventory.Inventory;
8 |
9 | public class CraftStorageMinecart extends CraftMinecart implements StorageMinecart {
10 | private CraftInventory inventory;
11 |
12 | public CraftStorageMinecart(CraftServer server, EntityMinecart entity) {
13 | super(server, entity);
14 | inventory = new CraftInventory(entity);
15 | }
16 |
17 | public Inventory getInventory() {
18 | return inventory;
19 | }
20 |
21 | @Override
22 | public String toString() {
23 | return "CraftStorageMinecart{" + "inventory=" + inventory + '}';
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.vehicle;
2 |
3 | import org.bukkit.Location;
4 | import org.bukkit.entity.Vehicle;
5 |
6 | /**
7 | * Raised when a vehicle moves.
8 | *
9 | * @author sk89q
10 | */
11 | public class VehicleMoveEvent extends VehicleEvent {
12 | private Location from;
13 | private Location to;
14 |
15 | public VehicleMoveEvent(Vehicle vehicle, Location from, Location to) {
16 | super(Type.VEHICLE_MOVE, vehicle);
17 |
18 | this.from = from;
19 | this.to = to;
20 | }
21 |
22 | /**
23 | * Get the previous position.
24 | *
25 | * @return
26 | */
27 | public Location getFrom() {
28 | return from;
29 | }
30 |
31 | /**
32 | * Get the next position.
33 | *
34 | * @return
35 | */
36 | public Location getTo() {
37 | return to;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet19EntityAction.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 |
7 | public class Packet19EntityAction extends Packet {
8 |
9 | public int a;
10 | public int animation;
11 |
12 | public Packet19EntityAction() {
13 | }
14 |
15 | public void a(DataInputStream datainputstream) throws IOException {
16 | this.a = datainputstream.readInt();
17 | this.animation = datainputstream.readByte();
18 | }
19 |
20 | public void a(DataOutputStream dataoutputstream) throws IOException {
21 | dataoutputstream.writeInt(this.a);
22 | dataoutputstream.writeByte(this.animation);
23 | }
24 |
25 | public void a(NetHandler nethandler) {
26 | nethandler.a(this);
27 | }
28 |
29 | public int a() {
30 | return 5;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/Packet70Bed.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 |
7 | public class Packet70Bed extends Packet {
8 |
9 | public static final String[] a = new String[] { "tile.bed.notValid", null, null };
10 | public int b;
11 |
12 | public Packet70Bed() {
13 | }
14 |
15 | public Packet70Bed(int i) {
16 | this.b = i;
17 | }
18 |
19 | public void a(DataInputStream datainputstream) throws IOException {
20 | this.b = datainputstream.readByte();
21 | }
22 |
23 | public void a(DataOutputStream dataoutputstream) throws IOException {
24 | dataoutputstream.writeByte(this.b);
25 | }
26 |
27 | public void a(NetHandler nethandler) {
28 | nethandler.a(this);
29 | }
30 |
31 | public int a() {
32 | return 1;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ItemRecord.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class ItemRecord extends Item {
4 |
5 | public final String a;
6 |
7 | protected ItemRecord(int i, String s) {
8 | super(i);
9 | this.a = s;
10 | this.maxStackSize = 1;
11 | }
12 |
13 | public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
14 | if (world.getTypeId(i, j, k) == Block.JUKEBOX.id && world.getData(i, j, k) == 0) {
15 | if (world.isStatic) {
16 | return true;
17 | } else {
18 | ((BlockJukeBox) Block.JUKEBOX).f(world, i, j, k, this.id);
19 | world.a((EntityHuman) null, 1005, i, j, k, this.id);
20 | --itemstack.count;
21 | return true;
22 | }
23 | } else {
24 | return false;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/entity/PigZombie.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.entity;
2 |
3 | /**
4 | * Represents a Pig Zombie.
5 | */
6 | public interface PigZombie extends Zombie {
7 | /**
8 | * Get the pig zombie's current anger level.
9 | *
10 | * @return The anger level.
11 | */
12 | int getAnger();
13 |
14 | /**
15 | * Set the pig zombie's current anger level.
16 | *
17 | * @param level The anger level. Higher levels of anger take longer to wear off.
18 | */
19 | void setAnger(int level);
20 |
21 | /**
22 | * Shorthand; sets to either 0 or the default level.
23 | *
24 | * @param angry Whether the zombie should be angry.
25 | */
26 | void setAngry(boolean angry);
27 |
28 | /**
29 | * Shorthand; gets whether the zombie is angry.
30 | *
31 | * @return True if the zombie is angry, otherwise false.
32 | */
33 | boolean isAngry();
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/entity/ItemDespawnEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.entity;
2 |
3 | import org.bukkit.Location;
4 | import org.bukkit.entity.Entity;
5 | import org.bukkit.event.Cancellable;
6 |
7 | public class ItemDespawnEvent extends EntityEvent implements Cancellable {
8 | private boolean canceled;
9 | private Location location;
10 |
11 | public ItemDespawnEvent(Entity spawnee, Location loc) {
12 | super(Type.ITEM_DESPAWN, spawnee);
13 | location = loc;
14 | }
15 |
16 | public boolean isCancelled() {
17 | return canceled;
18 | }
19 |
20 | public void setCancelled(boolean cancel) {
21 | canceled = cancel;
22 | }
23 |
24 | /**
25 | * Gets the location at which the item is despawning.
26 | *
27 | * @return The location at which the item is despawning
28 | */
29 | public Location getLocation() {
30 | return location;
31 | }
32 | }
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/scheduler/BukkitWorker.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.scheduler;
2 |
3 | import org.bukkit.plugin.Plugin;
4 |
5 | /**
6 | * Represents a worker thread for the scheduler. This gives information about
7 | * the Thread object for the task, owner of the task and the taskId.
8 | *
9 | * Workers are used to execute async tasks.
10 | */
11 |
12 | public interface BukkitWorker {
13 |
14 | /**
15 | * Returns the taskId for the task being executed by this worker
16 | *
17 | * @return Task id number
18 | */
19 | public int getTaskId();
20 |
21 | /**
22 | * Returns the Plugin that owns this task
23 | *
24 | * @return The Plugin that owns the task
25 | */
26 | public Plugin getOwner();
27 |
28 | /**
29 | * Returns the thread for the worker
30 | *
31 | * @return The Thread object for the worker
32 | */
33 | public Thread getThread();
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/NBTTagByteArray.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.DataInput;
4 | import java.io.DataOutput;
5 | import java.io.IOException;
6 |
7 | public class NBTTagByteArray extends NBTBase {
8 |
9 | public byte[] a;
10 |
11 | public NBTTagByteArray() {
12 | }
13 |
14 | public NBTTagByteArray(byte[] abyte) {
15 | this.a = abyte;
16 | }
17 |
18 | void a(DataOutput dataoutput) throws IOException {
19 | dataoutput.writeInt(this.a.length);
20 | dataoutput.write(this.a);
21 | }
22 |
23 | void a(DataInput datainput) throws IOException {
24 | int i = datainput.readInt();
25 |
26 | this.a = new byte[i];
27 | datainput.readFully(this.a);
28 | }
29 |
30 | public byte a() {
31 | return (byte) 7;
32 | }
33 |
34 | public String toString() {
35 | return "[" + this.a.length + " bytes]";
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/Instrument.java:
--------------------------------------------------------------------------------
1 | package org.bukkit;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | public enum Instrument {
7 |
8 | PIANO((byte) 0x0), // All other
9 | BASS_DRUM((byte) 0x1), // Stone
10 | SNARE_DRUM((byte) 0x2), // Sand
11 | STICKS((byte) 0x3), // Glass
12 | BASS_GUITAR((byte) 0x4); // Wood
13 |
14 | private final byte type;
15 | private final static Map types = new HashMap();
16 |
17 | private Instrument(byte type) {
18 | this.type = type;
19 | }
20 |
21 | public byte getType() {
22 | return this.type;
23 | }
24 |
25 | public static Instrument getByType(final byte type) {
26 | return types.get(type);
27 | }
28 |
29 | static {
30 | for (Instrument instrument : Instrument.values()) {
31 | types.put(instrument.getType(), instrument);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/material/PressurePlate.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.material;
2 |
3 | import org.bukkit.Material;
4 |
5 | /**
6 | * Represents a pressure plate
7 | */
8 | public class PressurePlate extends MaterialData implements PressureSensor {
9 | public PressurePlate() {
10 | super(Material.WOOD_PLATE);
11 | }
12 |
13 | public PressurePlate(int type) {
14 | super(type);
15 | }
16 |
17 | public PressurePlate(Material type) {
18 | super(type);
19 | }
20 |
21 | public PressurePlate(int type, byte data) {
22 | super(type, data);
23 | }
24 |
25 | public PressurePlate(Material type, byte data) {
26 | super(type, data);
27 | }
28 |
29 | public boolean isPressed() {
30 | return getData() == 0x1;
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | return super.toString() + (isPressed() ? " PRESSED" : "");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/craftbukkit/util/LongHash.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 |
6 | package org.bukkit.craftbukkit.util;
7 |
8 | /**
9 | * @author Nathan
10 | */
11 | public abstract class LongHash {
12 | static long toLong(int msw, int lsw) {
13 | return ((long) msw << 32) + lsw - Integer.MIN_VALUE;
14 | }
15 |
16 | static int msw(long l) {
17 | return (int) (l >> 32);
18 | }
19 |
20 | static int lsw(long l) {
21 | return (int) (l & 0xFFFFFFFF) + Integer.MIN_VALUE;
22 | }
23 |
24 | public boolean containsKey(int msw, int lsw) {
25 | return containsKey(toLong(msw, lsw));
26 | }
27 |
28 | public void remove(int msw, int lsw) {
29 | remove(toLong(msw, lsw));
30 | }
31 |
32 | public abstract boolean containsKey(long key);
33 |
34 | public abstract void remove(long key);
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/inventory/InventoryListener.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.inventory;
2 |
3 | import org.bukkit.event.Listener;
4 |
5 | /**
6 | * Handles all events thrown in relation to Blocks
7 | */
8 | public class InventoryListener implements Listener {
9 | public InventoryListener() {
10 | }
11 |
12 | /**
13 | * Called when an ItemStack is successfully smelted in a furnace.
14 | *
15 | * @param event Relevant event details
16 | */
17 | public void onFurnaceSmelt(FurnaceSmeltEvent event) {
18 | }
19 |
20 | /**
21 | * Called when an ItemStack is successfully burned as fuel in a furnace.
22 | *
23 | * @param event Relevant event details
24 | */
25 | public void onFurnaceBurn(FurnaceBurnEvent event) {
26 | }
27 |
28 | /**
29 | * @author moderator_man
30 | */
31 | public void onInventoryTransaction(InventoryTransactionEvent event) {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.entity.Player;
4 |
5 | /**
6 | * Called when a player leaves a server
7 | */
8 | public class PlayerQuitEvent extends PlayerEvent {
9 |
10 | private String quitMessage;
11 |
12 | public PlayerQuitEvent(Player who, String quitMessage) {
13 | super(Type.PLAYER_QUIT, who);
14 | this.quitMessage = quitMessage;
15 | }
16 |
17 | /**
18 | * Gets the quit message to send to all online players
19 | *
20 | * @return string quit message
21 | */
22 | public String getQuitMessage() {
23 | return quitMessage;
24 | }
25 |
26 | /**
27 | * Sets the quit message to send to all online players
28 | *
29 | * @param quitMessage quit message
30 | */
31 | public void setQuitMessage(String quitMessage) {
32 | this.quitMessage = quitMessage;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/weather/WeatherListener.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.weather;
2 |
3 | import org.bukkit.event.Listener;
4 |
5 | /**
6 | * Handles all events fired in relation to weather
7 | */
8 | public class WeatherListener implements Listener {
9 | public WeatherListener() {
10 | }
11 |
12 | /**
13 | * Called when a weather change occurs
14 | *
15 | * @param event Relevant event details
16 | */
17 | public void onWeatherChange(WeatherChangeEvent event) {
18 | }
19 |
20 | /**
21 | * Called when the state of thunder changes
22 | *
23 | * @param event Relevant event details
24 | */
25 | public void onThunderChange(ThunderChangeEvent event) {
26 | }
27 |
28 | /**
29 | * Called when lightning strikes
30 | *
31 | * @param event Relevant event details
32 | */
33 | public void onLightningStrike(LightningStrikeEvent event) {
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/command/defaults/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.command.defaults;
2 |
3 | import org.bukkit.Bukkit;
4 | import org.bukkit.ChatColor;
5 | import org.bukkit.command.Command;
6 | import org.bukkit.command.CommandSender;
7 |
8 | import java.util.Arrays;
9 |
10 | public class ReloadCommand extends Command {
11 | public ReloadCommand(String name) {
12 | super(name);
13 | this.description = "Reloads the server configuration and plugins";
14 | this.usageMessage = "/reload";
15 | this.setPermission("bukkit.command.reload");
16 | this.setAliases(Arrays.asList("rl"));
17 | }
18 |
19 | @Override
20 | public boolean execute(CommandSender sender, String currentAlias, String[] args) {
21 | if (!testPermission(sender)) return true;
22 |
23 | Bukkit.reload();
24 | sender.sendMessage(ChatColor.GREEN + "Reload complete.");
25 |
26 | return true;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java:
--------------------------------------------------------------------------------
1 | package org.bukkit.event.player;
2 |
3 | import org.bukkit.entity.Player;
4 |
5 | /**
6 | * Called when a player joins a server
7 | */
8 | public class PlayerJoinEvent extends PlayerEvent {
9 | private String joinMessage;
10 |
11 | public PlayerJoinEvent(Player playerJoined, String joinMessage) {
12 | super(Type.PLAYER_JOIN, playerJoined);
13 | this.joinMessage = joinMessage;
14 | }
15 |
16 | /**
17 | * Gets the join message to send to all online players
18 | *
19 | * @return string join message
20 | */
21 | public String getJoinMessage() {
22 | return joinMessage;
23 | }
24 |
25 | /**
26 | * Sets the join message to send to all online players
27 | *
28 | * @param joinMessage join message
29 | */
30 | public void setJoinMessage(String joinMessage) {
31 | this.joinMessage = joinMessage;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/MapGenBase.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.util.Random;
4 |
5 | public class MapGenBase {
6 |
7 | protected int a = 8;
8 | protected Random b = new Random();
9 |
10 | public MapGenBase() {
11 | }
12 |
13 | public void a(IChunkProvider ichunkprovider, World world, int i, int j, byte[] abyte) {
14 | int k = this.a;
15 |
16 | this.b.setSeed(world.getSeed());
17 | long l = this.b.nextLong() / 2L * 2L + 1L;
18 | long i1 = this.b.nextLong() / 2L * 2L + 1L;
19 |
20 | for (int j1 = i - k; j1 <= i + k; ++j1) {
21 | for (int k1 = j - k; k1 <= j + k; ++k1) {
22 | this.b.setSeed((long) j1 * l + (long) k1 * i1 ^ world.getSeed());
23 | this.a(world, j1, k1, i, j, abyte);
24 | }
25 | }
26 | }
27 |
28 | protected void a(World world, int i, int j, int k, int l, byte[] abyte) {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/ServerNBTManager.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | import java.io.File;
4 | import java.util.List;
5 |
6 | public class ServerNBTManager extends PlayerNBTManager {
7 |
8 | public ServerNBTManager(File file1, String s, boolean flag) {
9 | super(file1, s, flag);
10 | }
11 |
12 | public IChunkLoader a(WorldProvider worldprovider) {
13 | File file1 = this.a();
14 |
15 | if (worldprovider instanceof WorldProviderHell) {
16 | File file2 = new File(file1, "DIM-1");
17 |
18 | file2.mkdirs();
19 | return new ChunkRegionLoader(file2);
20 | } else {
21 | return new ChunkRegionLoader(file1);
22 | }
23 | }
24 |
25 | public void a(WorldData worlddata, List list) {
26 | worlddata.a(19132);
27 | super.a(worlddata, list);
28 | }
29 |
30 | public void e() {
31 | RegionFileCache.a();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/net/minecraft/server/PathEntity.java:
--------------------------------------------------------------------------------
1 | package net.minecraft.server;
2 |
3 | public class PathEntity {
4 |
5 | private final PathPoint[] b;
6 | public final int a;
7 | private int c;
8 |
9 | public PathEntity(PathPoint[] apathpoint) {
10 | this.b = apathpoint;
11 | this.a = apathpoint.length;
12 | }
13 |
14 | public void a() {
15 | ++this.c;
16 | }
17 |
18 | public boolean b() {
19 | return this.c >= this.b.length;
20 | }
21 |
22 | public PathPoint c() {
23 | return this.a > 0 ? this.b[this.a - 1] : null;
24 | }
25 |
26 | public Vec3D a(Entity entity) {
27 | double d0 = (double) this.b[this.c].a + (double) ((int) (entity.length + 1.0F)) * 0.5D;
28 | double d1 = (double) this.b[this.c].b;
29 | double d2 = (double) this.b[this.c].c + (double) ((int) (entity.length + 1.0F)) * 0.5D;
30 |
31 | return Vec3D.create(d0, d1, d2);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------