parent
c9eae197b2
commit
85502571ca
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"java.compile.nullAnalysis.mode": "disabled",
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
"java.configuration.updateBuildConfiguration": "interactive",
|
||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable"
|
||||
}
|
|
@ -23,7 +23,7 @@ dependencies {
|
|||
}
|
||||
|
||||
teavm.js {
|
||||
obfuscated = true
|
||||
obfuscated = false
|
||||
sourceMap = false
|
||||
targetFileName = "../classes.js"
|
||||
optimization = org.teavm.gradle.api.OptimizationLevel.AGGRESSIVE
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"normal": { "model": "end_bricks" }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"normal": { "model": "purpur_block" }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"normal": { "model": "purpur_block" }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=y": { "model": "purpur_pillar_top" },
|
||||
"axis=z": { "model": "purpur_pillar_top", "x": 90 },
|
||||
"axis=x": { "model": "purpur_pillar_top", "x": 90, "y": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"variants": {
|
||||
"half=bottom,variant=default": { "model": "half_slab_purpur" },
|
||||
"half=top,variant=default": { "model": "upper_slab_purpur" }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=straight": { "model": "purpur_stairs" },
|
||||
"facing=west,half=bottom,shape=straight": { "model": "purpur_stairs", "y": 180, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=straight": { "model": "purpur_stairs", "y": 90, "uvlock": true },
|
||||
"facing=north,half=bottom,shape=straight": { "model": "purpur_stairs", "y": 270, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=outer_right": { "model": "purpur_outer_stairs" },
|
||||
"facing=west,half=bottom,shape=outer_right": { "model": "purpur_outer_stairs", "y": 180, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=outer_right": { "model": "purpur_outer_stairs", "y": 90, "uvlock": true },
|
||||
"facing=north,half=bottom,shape=outer_right": { "model": "purpur_outer_stairs", "y": 270, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=outer_left": { "model": "purpur_outer_stairs", "y": 270, "uvlock": true },
|
||||
"facing=west,half=bottom,shape=outer_left": { "model": "purpur_outer_stairs", "y": 90, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=outer_left": { "model": "purpur_outer_stairs" },
|
||||
"facing=north,half=bottom,shape=outer_left": { "model": "purpur_outer_stairs", "y": 180, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=inner_right": { "model": "purpur_inner_stairs" },
|
||||
"facing=west,half=bottom,shape=inner_right": { "model": "purpur_inner_stairs", "y": 180, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=inner_right": { "model": "purpur_inner_stairs", "y": 90, "uvlock": true },
|
||||
"facing=north,half=bottom,shape=inner_right": { "model": "purpur_inner_stairs", "y": 270, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=inner_left": { "model": "purpur_inner_stairs", "y": 270, "uvlock": true },
|
||||
"facing=west,half=bottom,shape=inner_left": { "model": "purpur_inner_stairs", "y": 90, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=inner_left": { "model": "purpur_inner_stairs" },
|
||||
"facing=north,half=bottom,shape=inner_left": { "model": "purpur_inner_stairs", "y": 180, "uvlock": true },
|
||||
"facing=east,half=top,shape=straight": { "model": "purpur_stairs", "x": 180, "uvlock": true },
|
||||
"facing=west,half=top,shape=straight": { "model": "purpur_stairs", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=south,half=top,shape=straight": { "model": "purpur_stairs", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=north,half=top,shape=straight": { "model": "purpur_stairs", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=east,half=top,shape=outer_right": { "model": "purpur_outer_stairs", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=west,half=top,shape=outer_right": { "model": "purpur_outer_stairs", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=south,half=top,shape=outer_right": { "model": "purpur_outer_stairs", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=north,half=top,shape=outer_right": { "model": "purpur_outer_stairs", "x": 180, "uvlock": true },
|
||||
"facing=east,half=top,shape=outer_left": { "model": "purpur_outer_stairs", "x": 180, "uvlock": true },
|
||||
"facing=west,half=top,shape=outer_left": { "model": "purpur_outer_stairs", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=south,half=top,shape=outer_left": { "model": "purpur_outer_stairs", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=north,half=top,shape=outer_left": { "model": "purpur_outer_stairs", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=east,half=top,shape=inner_right": { "model": "purpur_inner_stairs", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=west,half=top,shape=inner_right": { "model": "purpur_inner_stairs", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=south,half=top,shape=inner_right": { "model": "purpur_inner_stairs", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=north,half=top,shape=inner_right": { "model": "purpur_inner_stairs", "x": 180, "uvlock": true },
|
||||
"facing=east,half=top,shape=inner_left": { "model": "purpur_inner_stairs", "x": 180, "uvlock": true },
|
||||
"facing=west,half=top,shape=inner_left": { "model": "purpur_inner_stairs", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=south,half=top,shape=inner_left": { "model": "purpur_inner_stairs", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=north,half=top,shape=inner_left": { "model": "purpur_inner_stairs", "x": 180, "y": 270, "uvlock": true }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "blocks/end_bricks"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/half_slab",
|
||||
"textures": {
|
||||
"bottom": "blocks/purpur_block",
|
||||
"top": "blocks/purpur_block",
|
||||
"side": "blocks/purpur_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "blocks/purpur_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/inner_stairs",
|
||||
"textures": {
|
||||
"bottom": "blocks/purpur_block",
|
||||
"top": "blocks/purpur_block",
|
||||
"side": "blocks/purpur_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/outer_stairs",
|
||||
"textures": {
|
||||
"bottom": "blocks/purpur_block",
|
||||
"top": "blocks/purpur_block",
|
||||
"side": "blocks/purpur_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "block/cube_column",
|
||||
"textures": {
|
||||
"end": "blocks/purpur_pillar_top",
|
||||
"side": "blocks/purpur_pillar"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/stairs",
|
||||
"textures": {
|
||||
"bottom": "blocks/purpur_block",
|
||||
"top": "blocks/purpur_block",
|
||||
"side": "blocks/purpur_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/upper_slab",
|
||||
"textures": {
|
||||
"bottom": "blocks/purpur_block",
|
||||
"top": "blocks/purpur_block",
|
||||
"side": "blocks/purpur_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "block/end_bricks",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "block/purpur_block",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "block/purpur_pillar_top",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "block/half_slab_purpur",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"parent": "block/purpur_stairs",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [ 0, 180, 0 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
[LocalizedFileNames]
|
||||
purpur_pillar.png=@purpur_pillar.png,0
|
||||
purpur_pillar_top.png=@purpur_pillar_top.png,0
|
||||
purpur_block.png=@purpur_block.png,0
|
||||
end_stone_bricks.png=@end_stone_bricks.png,0
|
Binary file not shown.
After Width: | Height: | Size: 273 B |
Binary file not shown.
After Width: | Height: | Size: 249 B |
Binary file not shown.
After Width: | Height: | Size: 228 B |
Binary file not shown.
After Width: | Height: | Size: 198 B |
Binary file not shown.
45063
javascript/classes.js
45063
javascript/classes.js
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,33 @@
|
|||
package net.hoosiertransfer;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
|
||||
public class EaglerCustomBlock {
|
||||
private Block block;
|
||||
private BlockSlab slabDouble;
|
||||
private boolean isSlab;
|
||||
|
||||
public EaglerCustomBlock(Block block) {
|
||||
this.block = block;
|
||||
this.isSlab = false;
|
||||
}
|
||||
|
||||
public EaglerCustomBlock(BlockSlab slabHalf, BlockSlab slabDouble) {
|
||||
this.block = (Block) slabHalf;
|
||||
this.slabDouble = slabDouble;
|
||||
this.isSlab = true;
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
public boolean isSlab() {
|
||||
return isSlab;
|
||||
}
|
||||
|
||||
public BlockSlab getSlabDouble() {
|
||||
return slabDouble;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package net.hoosiertransfer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class EaglerItems {
|
||||
private static Map<String, EaglerCustomBlock> blockMap = new HashMap<String, EaglerCustomBlock>();
|
||||
private static Map<String, Item> itemMap = new HashMap<String, Item>();
|
||||
|
||||
public static void registerEaglerBlock(String id, Block block) {
|
||||
blockMap.put(id, new EaglerCustomBlock(block));
|
||||
}
|
||||
|
||||
public static void registerEaglerSlab(String id, BlockSlab block, BlockSlab slabDouble) {
|
||||
blockMap.put(id, new EaglerCustomBlock(block, slabDouble));
|
||||
}
|
||||
|
||||
public static EaglerCustomBlock getEaglerCustomBlock(String id) {
|
||||
return blockMap.get(id);
|
||||
}
|
||||
|
||||
public static Block getEaglerBlock(String id) {
|
||||
return blockMap.get(id).getBlock();
|
||||
}
|
||||
|
||||
public static void registerEaglerItem(String id, Item item) {
|
||||
itemMap.put(id, item);
|
||||
}
|
||||
|
||||
public static List<EaglerCustomBlock> getEaglerCustomBlocks() {
|
||||
return (List<EaglerCustomBlock>) blockMap.values();
|
||||
}
|
||||
|
||||
public static List<Item> getEaglerItems() {
|
||||
return (List<Item>) itemMap.values();
|
||||
}
|
||||
|
||||
public static List<String> getEaglerBlockIds() {
|
||||
return (List<String>) blockMap.keySet();
|
||||
}
|
||||
|
||||
public static List<String> getEaglerItemIds() {
|
||||
return (List<String>) itemMap.keySet();
|
||||
}
|
||||
|
||||
public static List<Map.Entry<String, EaglerCustomBlock>> getEaglerCustomBlockEntries() {
|
||||
return (List<Map.Entry<String, EaglerCustomBlock>>) blockMap.entrySet();
|
||||
}
|
||||
|
||||
public static List<Map.Entry<String, Item>> getEaglerItemEntries() {
|
||||
return (List<Map.Entry<String, Item>>) itemMap.entrySet();
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package net.minecraft.block;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.hoosiertransfer.EaglerItems;
|
||||
import net.hoosiertransfer.Alfheim.ILightInfoProvider;
|
||||
import net.hoosiertransfer.Alfheim.ILightLevelProvider;
|
||||
import net.hoosiertransfer.Alfheim.ILitBlock;
|
||||
|
@ -40,28 +41,38 @@ import net.minecraft.world.Explosion;
|
|||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class Block implements ILitBlock {
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* ResourceLocation for the Air block
|
||||
*/
|
||||
private static final ResourceLocation AIR_ID = new ResourceLocation("air");
|
||||
|
@ -70,11 +81,13 @@ public class Block implements ILitBlock {
|
|||
public static final ObjectIntIdentityMap<IBlockState> BLOCK_STATE_IDS = new ObjectIntIdentityMap();
|
||||
private CreativeTabs displayOnCreativeTab;
|
||||
public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F);
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* the wood sound type
|
||||
*/
|
||||
public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F);
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* the gravel sound type
|
||||
*/
|
||||
public static final Block.SoundType soundTypeGravel = new Block.SoundType("gravel", 1.0F, 1.0F);
|
||||
|
@ -149,7 +162,8 @@ public class Block implements ILitBlock {
|
|||
return blockRegistry.getIDForObject(blockIn);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get a unique ID for the given BlockState, containing both
|
||||
* BlockID and metadata
|
||||
*/
|
||||
|
@ -162,7 +176,8 @@ public class Block implements ILitBlock {
|
|||
return (Block) blockRegistry.getObjectById(id);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get a BlockState by it's ID (see getStateId)
|
||||
*/
|
||||
public static IBlockState getStateById(int id) {
|
||||
|
@ -196,7 +211,8 @@ public class Block implements ILitBlock {
|
|||
return this.lightOpacity;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Used in the renderer to apply ambient occlusion
|
||||
*/
|
||||
public boolean isTranslucent() {
|
||||
|
@ -207,7 +223,8 @@ public class Block implements ILitBlock {
|
|||
return this.lightValue;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Should block use the brightest neighbor light value as its
|
||||
* own
|
||||
*/
|
||||
|
@ -215,28 +232,32 @@ public class Block implements ILitBlock {
|
|||
return this.useNeighborBrightness;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get a material of block
|
||||
*/
|
||||
public Material getMaterial() {
|
||||
return this.blockMaterial;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get the MapColor for this Block and the given BlockState
|
||||
*/
|
||||
public MapColor getMapColor(IBlockState state) {
|
||||
return this.field_181083_K;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public IBlockState getStateFromMeta(int var1) {
|
||||
return this.getDefaultState();
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(IBlockState iblockstate) {
|
||||
|
@ -247,7 +268,8 @@ public class Block implements ILitBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get the actual Block state of this Block at the given
|
||||
* position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
|
@ -275,7 +297,8 @@ public class Block implements ILitBlock {
|
|||
this(materialIn, materialIn.getMaterialMapColor());
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets the footstep sound for the block. Returns the object for
|
||||
* convenience in constructing.
|
||||
*/
|
||||
|
@ -284,7 +307,8 @@ public class Block implements ILitBlock {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets how much light is blocked going through this block.
|
||||
* Returns the object for convenience in constructing.
|
||||
*/
|
||||
|
@ -293,7 +317,8 @@ public class Block implements ILitBlock {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets the light value that the block emits. Returns resulting
|
||||
* block instance for constructing convenience. Args: level
|
||||
*/
|
||||
|
@ -302,7 +327,8 @@ public class Block implements ILitBlock {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets the the blocks resistance to explosions. Returns the
|
||||
* object for convenience in constructing.
|
||||
*/
|
||||
|
@ -311,14 +337,16 @@ public class Block implements ILitBlock {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Indicate if a material is a normal solid opaque cube
|
||||
*/
|
||||
public boolean isBlockNormalCube() {
|
||||
return this.blockMaterial.blocksMovement() && this.isFullCube();
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Used for nearly all game logic (non-rendering) purposes. Use
|
||||
* Forge-provided isNormalCube(IBlockAccess, BlockPos) instead.
|
||||
*/
|
||||
|
@ -338,7 +366,8 @@ public class Block implements ILitBlock {
|
|||
return !this.blockMaterial.blocksMovement();
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* The type of render function called. 3 for standard block
|
||||
* models, 2 for TESR's, 1 for liquids, -1 is no render
|
||||
*/
|
||||
|
@ -346,7 +375,8 @@ public class Block implements ILitBlock {
|
|||
return 3;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Whether this Block can be replaced directly by other blocks
|
||||
* (true for e.g. tall grass)
|
||||
*/
|
||||
|
@ -354,7 +384,8 @@ public class Block implements ILitBlock {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets how many hits it takes to break a block.
|
||||
*/
|
||||
protected Block setHardness(float hardness) {
|
||||
|
@ -375,7 +406,8 @@ public class Block implements ILitBlock {
|
|||
return this.blockHardness;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets whether this block type will receive random update ticks
|
||||
*/
|
||||
protected Block setTickRandomly(boolean shouldTick) {
|
||||
|
@ -383,7 +415,8 @@ public class Block implements ILitBlock {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns whether or not this block is of a type that needs
|
||||
* random ticking. Called for ref-counting purposes by
|
||||
* ExtendedBlockStorage in order to broadly cull a chunk from
|
||||
|
@ -429,7 +462,8 @@ public class Block implements ILitBlock {
|
|||
.isOpaqueCube())))));
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Whether this Block is solid on the given Side
|
||||
*/
|
||||
public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
|
||||
|
@ -442,7 +476,8 @@ public class Block implements ILitBlock {
|
|||
(double) blockpos.getY() + this.maxY, (double) blockpos.getZ() + this.maxZ);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Add all collision boxes of this Block to the list that
|
||||
* intersect with the given mask.
|
||||
*/
|
||||
|
@ -461,7 +496,8 @@ public class Block implements ILitBlock {
|
|||
(double) blockpos.getY() + this.maxY, (double) blockpos.getZ() + this.maxZ);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Used to determine ambient occlusion and culling when
|
||||
* rebuilding chunks for render
|
||||
*/
|
||||
|
@ -473,7 +509,8 @@ public class Block implements ILitBlock {
|
|||
return this.isCollidable();
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns if this block is collidable (only used by Fire).
|
||||
* Args: x, y, z
|
||||
*/
|
||||
|
@ -481,7 +518,8 @@ public class Block implements ILitBlock {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called randomly when setTickRandomly is set to true (used by
|
||||
* e.g. crops to grow, etc.)
|
||||
*/
|
||||
|
@ -495,19 +533,22 @@ public class Block implements ILitBlock {
|
|||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when a player destroys this Block
|
||||
*/
|
||||
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World var1, BlockPos var2, IBlockState var3, Block var4) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* How many world ticks before ticking
|
||||
*/
|
||||
public int tickRate(World var1) {
|
||||
|
@ -520,21 +561,24 @@ public class Block implements ILitBlock {
|
|||
public void breakBlock(World var1, BlockPos var2, IBlockState var3) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
public int quantityDropped(EaglercraftRandom random) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get the hardness of this Block relative to the ability of the
|
||||
* given player
|
||||
*/
|
||||
|
@ -545,14 +589,16 @@ public class Block implements ILitBlock {
|
|||
: playerIn.getToolDigEfficiency(this) / f / 30.0F);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Spawn this Block's drops into the World as EntityItems
|
||||
*/
|
||||
public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) {
|
||||
this.dropBlockAsItemWithChance(worldIn, pos, state, 1.0F, forture);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) {
|
||||
|
@ -570,7 +616,8 @@ public class Block implements ILitBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Spawns the given ItemStack as an EntityItem into the World at
|
||||
* the given position
|
||||
*/
|
||||
|
@ -587,7 +634,8 @@ public class Block implements ILitBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Spawns the given amount of experience into the World as XP
|
||||
* orb entities
|
||||
*/
|
||||
|
@ -602,7 +650,8 @@ public class Block implements ILitBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Gets the metadata of the item this Block can drop. This
|
||||
* method is called when the block gets destroyed. It returns
|
||||
* the metadata of the dropped item based on the old metadata of
|
||||
|
@ -612,7 +661,8 @@ public class Block implements ILitBlock {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns how much this block can resist explosions from the
|
||||
* passed in entity.
|
||||
*/
|
||||
|
@ -620,7 +670,8 @@ public class Block implements ILitBlock {
|
|||
return this.blockResistance / 5.0F;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Ray traces through the blocks collision from start vector to
|
||||
* end vector returning a ray trace hit.
|
||||
*/
|
||||
|
@ -717,7 +768,8 @@ public class Block implements ILitBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Checks if a vector is within the Y and Z bounds of the block.
|
||||
*/
|
||||
private boolean isVecInsideYZBounds(Vec3 point) {
|
||||
|
@ -726,7 +778,8 @@ public class Block implements ILitBlock {
|
|||
&& point.zCoord <= this.maxZ;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Checks if a vector is within the X and Z bounds of the block.
|
||||
*/
|
||||
private boolean isVecInsideXZBounds(Vec3 point) {
|
||||
|
@ -735,7 +788,8 @@ public class Block implements ILitBlock {
|
|||
&& point.zCoord <= this.maxZ;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Checks if a vector is within the X and Y bounds of the block.
|
||||
*/
|
||||
private boolean isVecInsideXYBounds(Vec3 point) {
|
||||
|
@ -744,7 +798,8 @@ public class Block implements ILitBlock {
|
|||
&& point.yCoord <= this.maxY;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when this Block is destroyed by an Explosion
|
||||
*/
|
||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
|
||||
|
@ -758,7 +813,8 @@ public class Block implements ILitBlock {
|
|||
return this.canPlaceBlockOnSide(worldIn, pos, side);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Check whether this Block can be placed on the given side
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) {
|
||||
|
@ -774,13 +830,15 @@ public class Block implements ILitBlock {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called by ItemBlocks just before a block is actually set in
|
||||
* the world, to allow for adjustments to the IBlockstate
|
||||
*/
|
||||
|
@ -799,42 +857,48 @@ public class Block implements ILitBlock {
|
|||
public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the block bounderies minX value
|
||||
*/
|
||||
public final double getBlockBoundsMinX() {
|
||||
return this.minX;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the block bounderies maxX value
|
||||
*/
|
||||
public final double getBlockBoundsMaxX() {
|
||||
return this.maxX;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the block bounderies minY value
|
||||
*/
|
||||
public final double getBlockBoundsMinY() {
|
||||
return this.minY;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the block bounderies maxY value
|
||||
*/
|
||||
public final double getBlockBoundsMaxY() {
|
||||
return this.maxY;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the block bounderies minZ value
|
||||
*/
|
||||
public final double getBlockBoundsMinZ() {
|
||||
return this.minZ;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the block bounderies maxZ value
|
||||
*/
|
||||
public final double getBlockBoundsMaxZ() {
|
||||
|
@ -861,7 +925,8 @@ public class Block implements ILitBlock {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Can this block provide power. Only wire currently seems to
|
||||
* have this change based on its state.
|
||||
*/
|
||||
|
@ -869,7 +934,8 @@ public class Block implements ILitBlock {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World var1, BlockPos var2, IBlockState var3, Entity var4) {
|
||||
|
@ -879,7 +945,8 @@ public class Block implements ILitBlock {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender() {
|
||||
|
@ -915,14 +982,16 @@ public class Block implements ILitBlock {
|
|||
return new ItemStack(item, 1, i);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get the quantity dropped based on the given fortune level
|
||||
*/
|
||||
public int quantityDroppedWithBonus(int fortune, EaglercraftRandom random) {
|
||||
return this.quantityDropped(random);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called by ItemBlocks after a block is set in the world, to
|
||||
* allow post-place logic
|
||||
*/
|
||||
|
@ -938,7 +1007,8 @@ public class Block implements ILitBlock {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Gets the localized name of this block. Used for the
|
||||
* statistics page.
|
||||
*/
|
||||
|
@ -946,7 +1016,8 @@ public class Block implements ILitBlock {
|
|||
return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the unlocalized name of the block with "tile."
|
||||
* appended to the front.
|
||||
*/
|
||||
|
@ -954,7 +1025,8 @@ public class Block implements ILitBlock {
|
|||
return "tile." + this.unlocalizedName;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called on both Client and Server when World#addBlockEvent is
|
||||
* called
|
||||
*/
|
||||
|
@ -962,7 +1034,8 @@ public class Block implements ILitBlock {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Return the state of blocks statistics flags - if the block is
|
||||
* counted for mined and placed.
|
||||
*/
|
||||
|
@ -979,7 +1052,8 @@ public class Block implements ILitBlock {
|
|||
return this.blockMaterial.getMaterialMobility();
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the default ambient occlusion value based on block
|
||||
* opacity
|
||||
*/
|
||||
|
@ -993,14 +1067,16 @@ public class Block implements ILitBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Block's chance to react to a living entity falling on it.
|
||||
*/
|
||||
public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) {
|
||||
entityIn.fall(fallDistance, 1.0F);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when an Entity lands on this Block. This method *must*
|
||||
* update motionY because the entity will not do that on its own
|
||||
*/
|
||||
|
@ -1016,7 +1092,8 @@ public class Block implements ILitBlock {
|
|||
return this.damageDropped(worldIn.getBlockState(pos));
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns a list of blocks with the same ID, but different meta
|
||||
* (eg: wood returns 4 blocks)
|
||||
*/
|
||||
|
@ -1024,7 +1101,8 @@ public class Block implements ILitBlock {
|
|||
list.add(new ItemStack(item, 1, 0));
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the CreativeTab to display the given block on.
|
||||
*/
|
||||
public CreativeTabs getCreativeTabToDisplayOn() {
|
||||
|
@ -1039,13 +1117,15 @@ public class Block implements ILitBlock {
|
|||
public void onBlockHarvested(World var1, BlockPos var2, IBlockState var3, EntityPlayer var4) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called similar to random ticks, but only when it is raining.
|
||||
*/
|
||||
public void fillWithRain(World worldIn, BlockPos pos) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns true only if block is flowerPot
|
||||
*/
|
||||
public boolean isFlowerPot() {
|
||||
|
@ -1056,7 +1136,8 @@ public class Block implements ILitBlock {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Return whether this block can drop from an explosion.
|
||||
*/
|
||||
public boolean canDropFromExplosion(Explosion explosionIn) {
|
||||
|
@ -1079,7 +1160,8 @@ public class Block implements ILitBlock {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Possibly modify the given BlockState before rendering it on
|
||||
* an Entity (Minecarts, Endermen, ...)
|
||||
*/
|
||||
|
@ -1103,7 +1185,8 @@ public class Block implements ILitBlock {
|
|||
return this.defaultBlockState;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Get the OffsetType for this Block. Determines if the model is
|
||||
* rendered slightly offset.
|
||||
*/
|
||||
|
@ -1556,6 +1639,26 @@ public class Block implements ILitBlock {
|
|||
.setStepSound(soundTypeWood).setUnlocalizedName("doorAcacia").disableStats());
|
||||
registerBlock(197, (String) "dark_oak_door", (new BlockDoor(Material.wood)).setHardness(3.0F)
|
||||
.setStepSound(soundTypeWood).setUnlocalizedName("doorDarkOak").disableStats());
|
||||
|
||||
Block purpurBlock = (new Block(Material.rock)).setHardness(1.5F).setResistance(10.0F)
|
||||
.setStepSound(soundTypeStone).setCreativeTab(CreativeTabs.tabBlock).setUnlocalizedName("purpurBlock");
|
||||
registerEaglerBlock(201, (String) "purpur_block", purpurBlock);
|
||||
registerEaglerBlock(202, "purpur_pillar",
|
||||
(new BlockPurpurPillar()).setHardness(1.5F).setResistance(10.0F)
|
||||
.setStepSound(soundTypeStone).setUnlocalizedName("purpurPillar"));
|
||||
registerEaglerBlock(203, "purpur_stairs", (new BlockStairs(purpurBlock.getDefaultState()))
|
||||
.setUnlocalizedName("stairsPurpur"));
|
||||
// registerEaglerBlock(204, "purpur_double_slab", (new
|
||||
// BlockPurpurSlab.Double()).setHardness(2.0F)
|
||||
// .setResistance(10.0F).setStepSound(soundTypeStone).setUnlocalizedName("purpurSlab"));\
|
||||
// registerEaglerBlock(205, "purpur_slab", (new
|
||||
// BlockPurpurSlab.Half()).setHardness(2.0F).setResistance(10.0F)
|
||||
// .setStepSound(soundTypeStone).setUnlocalizedName("purpurSlab"));
|
||||
registerEaglerSlab(204, "purpur_double_slab", new BlockPurpurSlab.Double(), 205, "purpur_slab",
|
||||
new BlockPurpurSlab.Half());
|
||||
registerEaglerBlock(206, "end_bricks", (new Block(Material.rock)).setStepSound(soundTypeStone).setHardness(0.8F)
|
||||
.setCreativeTab(CreativeTabs.tabBlock).setUnlocalizedName("endBricks"));
|
||||
|
||||
blockRegistry.validateKey();
|
||||
|
||||
for (Block block13 : blockRegistry) {
|
||||
|
@ -1623,6 +1726,8 @@ public class Block implements ILitBlock {
|
|||
BlockTrapDoor.bootstrapStates();
|
||||
BlockWall.bootstrapStates();
|
||||
BlockWoodSlab.bootstrapStates();
|
||||
|
||||
BlockPurpurSlab.bootstrapStates();
|
||||
}
|
||||
|
||||
private static void registerBlock(int id, ResourceLocation textualID, Block block_) {
|
||||
|
@ -1633,6 +1738,18 @@ public class Block implements ILitBlock {
|
|||
registerBlock(id, new ResourceLocation(textualID), block_);
|
||||
}
|
||||
|
||||
private static void registerEaglerBlock(int id, String textualID, Block block_) {
|
||||
EaglerItems.registerEaglerBlock(textualID, block_);
|
||||
registerBlock(id, textualID, block_);
|
||||
}
|
||||
|
||||
private static void registerEaglerSlab(int id1, String textualID1, BlockSlab slabDouble, int id2, String textualID2,
|
||||
BlockSlab slabHalf) {
|
||||
EaglerItems.registerEaglerSlab(textualID1, slabHalf, slabDouble);
|
||||
registerBlock(id1, textualID1, slabDouble);
|
||||
registerBlock(id2, textualID2, slabHalf);
|
||||
}
|
||||
|
||||
public static enum EnumOffsetType {
|
||||
NONE, XZ, XYZ;
|
||||
}
|
||||
|
@ -1673,7 +1790,8 @@ public class Block implements ILitBlock {
|
|||
return false;
|
||||
}
|
||||
|
||||
public int alfheim$getLightFor(final IBlockState blockState, final IBlockAccess blockAccess, final EnumSkyBlock lightType, final BlockPos blockPos) {
|
||||
public int alfheim$getLightFor(final IBlockState blockState, final IBlockAccess blockAccess,
|
||||
final EnumSkyBlock lightType, final BlockPos blockPos) {
|
||||
int lightLevel = ((ILightLevelProvider) blockAccess).alfheim$getLight(lightType, blockPos);
|
||||
|
||||
if (lightLevel == 15)
|
||||
|
@ -1685,9 +1803,11 @@ public class Block implements ILitBlock {
|
|||
for (EnumFacing facing : EnumFacing._VALUES) {
|
||||
if (((ILightInfoProvider) blockState).alfheim$useNeighborBrightness(facing, blockAccess, blockPos)) {
|
||||
int opacity = ((ILightInfoProvider) blockState).alfheim$getLightOpacity(facing, blockAccess, blockPos);
|
||||
final int neighborLightLevel = ((ILightLevelProvider) blockAccess).alfheim$getLight(lightType, blockPos.offset(facing));
|
||||
final int neighborLightLevel = ((ILightLevelProvider) blockAccess).alfheim$getLight(lightType,
|
||||
blockPos.offset(facing));
|
||||
|
||||
if (opacity == 0 && (lightType != EnumSkyBlock.SKY || neighborLightLevel != EnumSkyBlock.SKY.defaultLightValue))
|
||||
if (opacity == 0
|
||||
&& (lightType != EnumSkyBlock.SKY || neighborLightLevel != EnumSkyBlock.SKY.defaultLightValue))
|
||||
opacity = 1;
|
||||
|
||||
lightLevel = Math.max(lightLevel, neighborLightLevel - opacity);
|
||||
|
@ -1700,12 +1820,14 @@ public class Block implements ILitBlock {
|
|||
return lightLevel;
|
||||
}
|
||||
|
||||
public boolean alfheim$useNeighborBrightness(final IBlockState blockState, final EnumFacing facing, final IBlockAccess blockAccess, final BlockPos blockPos) {
|
||||
public boolean alfheim$useNeighborBrightness(final IBlockState blockState, final EnumFacing facing,
|
||||
final IBlockAccess blockAccess, final BlockPos blockPos) {
|
||||
return facing == EnumFacing.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int alfheim$getLightOpacity(final IBlockState blockState, final EnumFacing facing, final IBlockAccess blockAccess, final BlockPos blockPos) {
|
||||
public int alfheim$getLightOpacity(final IBlockState blockState, final EnumFacing facing,
|
||||
final IBlockAccess blockAccess, final BlockPos blockPos) {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -13,22 +13,31 @@ import net.minecraft.util.BlockPos;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
|
@ -40,7 +49,8 @@ public class BlockHay extends BlockRotatedPillar {
|
|||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public IBlockState getStateFromMeta(int i) {
|
||||
|
@ -55,7 +65,8 @@ public class BlockHay extends BlockRotatedPillar {
|
|||
return this.getDefaultState().withProperty(AXIS, enumfacing$axis);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(IBlockState iblockstate) {
|
||||
|
@ -78,7 +89,8 @@ public class BlockHay extends BlockRotatedPillar {
|
|||
return new ItemStack(Item.getItemFromBlock(this), 1, 0);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called by ItemBlocks just before a block is actually set in
|
||||
* the world, to allow for adjustments to the IBlockstate
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package net.minecraft.block;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class BlockPurpurPillar extends BlockRotatedPillar {
|
||||
public BlockPurpurPillar() {
|
||||
super(Material.rock);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
public IBlockState getStateFromMeta(int i) {
|
||||
EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Y;
|
||||
int j = i & 12;
|
||||
if (j == 4) {
|
||||
enumfacing$axis = EnumFacing.Axis.X;
|
||||
} else if (j == 8) {
|
||||
enumfacing$axis = EnumFacing.Axis.Z;
|
||||
}
|
||||
|
||||
return this.getDefaultState().withProperty(AXIS, enumfacing$axis);
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(IBlockState iblockstate) {
|
||||
int i = 0;
|
||||
EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis) iblockstate.getValue(AXIS);
|
||||
if (enumfacing$axis == EnumFacing.Axis.X) {
|
||||
i |= 4;
|
||||
} else if (enumfacing$axis == EnumFacing.Axis.Z) {
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, new IProperty[] { AXIS });
|
||||
}
|
||||
|
||||
protected ItemStack createStackedBlock(IBlockState var1) {
|
||||
return new ItemStack(Item.getItemFromBlock(this), 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Called by ItemBlocks just before a block is actually set in
|
||||
* the world, to allow for adjustments to the IBlockstate
|
||||
*/
|
||||
public IBlockState onBlockPlaced(World world, BlockPos blockpos, EnumFacing enumfacing, float f, float f1, float f2,
|
||||
int i, EntityLivingBase entitylivingbase) {
|
||||
return super.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, entitylivingbase).withProperty(AXIS,
|
||||
enumfacing.getAxis());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,254 @@
|
|||
package net.minecraft.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.hoosiertransfer.EaglerItems;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public abstract class BlockPurpurSlab extends BlockSlab {
|
||||
public static final PropertyBool SEAMLESS = PropertyBool.create("seamless");
|
||||
public static PropertyEnum<BlockPurpurSlab.EnumType> VARIANT;
|
||||
|
||||
public BlockPurpurSlab() {
|
||||
super(Material.rock);
|
||||
IBlockState iblockstate = this.blockState.getBaseState();
|
||||
if (this.isDouble()) {
|
||||
iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false));
|
||||
} else {
|
||||
iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
|
||||
}
|
||||
|
||||
this.setDefaultState(iblockstate.withProperty(VARIANT, BlockPurpurSlab.EnumType.STONE));
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
public static void bootstrapStates() {
|
||||
VARIANT = PropertyEnum.<BlockPurpurSlab.EnumType>create("variant", BlockPurpurSlab.EnumType.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) {
|
||||
return Item.getItemFromBlock(EaglerItems.getEaglerBlock("purpur_slab"));
|
||||
}
|
||||
|
||||
public Item getItem(World var1, BlockPos var2) {
|
||||
return Item.getItemFromBlock(EaglerItems.getEaglerBlock("purpur_slab"));
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Returns the slab block name with the type associated with it
|
||||
*/
|
||||
public String getUnlocalizedName(int i) {
|
||||
return super.getUnlocalizedName() + "." + BlockPurpurSlab.EnumType.byMetadata(i).getUnlocalizedName();
|
||||
}
|
||||
|
||||
public IProperty<?> getVariantProperty() {
|
||||
return VARIANT;
|
||||
}
|
||||
|
||||
public Object getVariant(ItemStack itemstack) {
|
||||
return BlockPurpurSlab.EnumType.byMetadata(itemstack.getMetadata() & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* returns a list of blocks with the same ID, but different meta
|
||||
* (eg: wood returns 4 blocks)
|
||||
*/
|
||||
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
|
||||
if (item != Item.getItemFromBlock(Blocks.double_stone_slab)) {
|
||||
BlockPurpurSlab.EnumType[] types = BlockPurpurSlab.EnumType.META_LOOKUP;
|
||||
for (int i = 0; i < types.length; ++i) {
|
||||
BlockPurpurSlab.EnumType BlockPurpurSlab$enumtype = types[i];
|
||||
if (BlockPurpurSlab$enumtype != BlockPurpurSlab.EnumType.WOOD) {
|
||||
list.add(new ItemStack(item, 1, BlockPurpurSlab$enumtype.getMetadata()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public IBlockState getStateFromMeta(int i) {
|
||||
IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT,
|
||||
BlockPurpurSlab.EnumType.byMetadata(i & 7));
|
||||
if (this.isDouble()) {
|
||||
iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf((i & 8) != 0));
|
||||
} else {
|
||||
iblockstate = iblockstate.withProperty(HALF,
|
||||
(i & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP);
|
||||
}
|
||||
|
||||
return iblockstate;
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(IBlockState iblockstate) {
|
||||
int i = 0;
|
||||
i = i | ((BlockPurpurSlab.EnumType) iblockstate.getValue(VARIANT)).getMetadata();
|
||||
if (this.isDouble()) {
|
||||
if (((Boolean) iblockstate.getValue(SEAMLESS)).booleanValue()) {
|
||||
i |= 8;
|
||||
}
|
||||
} else if (iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) {
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected BlockState createBlockState() {
|
||||
return this.isDouble() ? new BlockState(this, new IProperty[] { SEAMLESS, VARIANT })
|
||||
: new BlockState(this, new IProperty[] { HALF, VARIANT });
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Gets the metadata of the item this Block can drop. This
|
||||
* method is called when the block gets destroyed. It returns
|
||||
* the metadata of the dropped item based on the old metadata of
|
||||
* the block.
|
||||
*/
|
||||
public int damageDropped(IBlockState iblockstate) {
|
||||
return ((BlockPurpurSlab.EnumType) iblockstate.getValue(VARIANT)).getMetadata();
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Get the MapColor for this Block and the given BlockState
|
||||
*/
|
||||
public MapColor getMapColor(IBlockState iblockstate) {
|
||||
return ((BlockPurpurSlab.EnumType) iblockstate.getValue(VARIANT)).func_181074_c();
|
||||
}
|
||||
|
||||
public static class Double extends BlockPurpurSlab {
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Half extends BlockPurpurSlab {
|
||||
public boolean isDouble() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum EnumType implements IStringSerializable {
|
||||
STONE(0, MapColor.stoneColor, "stone"), SAND(1, MapColor.sandColor, "sandstone", "sand"),
|
||||
WOOD(2, MapColor.woodColor, "wood_old", "wood"), COBBLESTONE(3, MapColor.stoneColor, "cobblestone", "cobble"),
|
||||
BRICK(4, MapColor.redColor, "brick"), SMOOTHBRICK(5, MapColor.stoneColor, "stone_brick", "smoothStoneBrick"),
|
||||
NETHERBRICK(6, MapColor.netherrackColor, "nether_brick", "netherBrick"),
|
||||
QUARTZ(7, MapColor.quartzColor, "quartz");
|
||||
|
||||
public static final BlockPurpurSlab.EnumType[] META_LOOKUP = new BlockPurpurSlab.EnumType[8];
|
||||
private final int meta;
|
||||
private final MapColor field_181075_k;
|
||||
private final String name;
|
||||
private final String unlocalizedName;
|
||||
|
||||
private EnumType(int parInt2, MapColor parMapColor, String parString2) {
|
||||
this(parInt2, parMapColor, parString2, parString2);
|
||||
}
|
||||
|
||||
private EnumType(int parInt2, MapColor parMapColor, String parString2, String parString3) {
|
||||
this.meta = parInt2;
|
||||
this.field_181075_k = parMapColor;
|
||||
this.name = parString2;
|
||||
this.unlocalizedName = parString3;
|
||||
}
|
||||
|
||||
public int getMetadata() {
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
public MapColor func_181074_c() {
|
||||
return this.field_181075_k;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public static BlockPurpurSlab.EnumType byMetadata(int meta) {
|
||||
if (meta < 0 || meta >= META_LOOKUP.length) {
|
||||
meta = 0;
|
||||
}
|
||||
|
||||
return META_LOOKUP[meta];
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* +
|
||||
* Returns the slab block name with the type associated with it
|
||||
*/
|
||||
public String getUnlocalizedName() {
|
||||
return this.unlocalizedName;
|
||||
}
|
||||
|
||||
static {
|
||||
BlockPurpurSlab.EnumType[] types = values();
|
||||
for (int i = 0; i < types.length; ++i) {
|
||||
META_LOOKUP[types[i].getMetadata()] = types[i];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,28 +4,45 @@ import net.minecraft.block.material.MapColor;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public abstract class BlockRotatedPillar extends Block {
|
||||
public class BlockRotatedPillar extends Block {
|
||||
public static final PropertyEnum<EnumFacing.Axis> AXIS = PropertyEnum.<EnumFacing.Axis>create("axis",
|
||||
EnumFacing.Axis.class);
|
||||
|
||||
|
|
|
@ -3,8 +3,11 @@ package net.minecraft.client.renderer.entity;
|
|||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.hoosiertransfer.EaglerCustomBlock;
|
||||
import net.hoosiertransfer.EaglerItems;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
|
||||
|
@ -67,22 +70,31 @@ import net.minecraft.util.ReportedException;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3i;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
|
@ -473,7 +485,8 @@ public class RenderItem implements IResourceManagerReloadListener {
|
|||
this.renderItemOverlayIntoGUI(fr, stack, xPosition, yPosition, (String) null);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Renders the stack size and/or damage bar for the given
|
||||
* ItemStack.
|
||||
*/
|
||||
|
@ -1091,6 +1104,14 @@ public class RenderItem implements IResourceManagerReloadListener {
|
|||
this.registerBlock(Blocks.red_mushroom_block, BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(),
|
||||
"red_mushroom_block");
|
||||
this.registerBlock(Blocks.dragon_egg, "dragon_egg");
|
||||
|
||||
for (Map.Entry<String, EaglerCustomBlock> entry : EaglerItems.getEaglerCustomBlockEntries()) {
|
||||
this.registerBlock(entry.getValue().getBlock(), entry.getKey());
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Item> entry : EaglerItems.getEaglerItemEntries()) {
|
||||
this.registerItem(entry.getValue(), entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
public void onResourceManagerReload(IResourceManager var1) {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package net.minecraft.init;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.hoosiertransfer.EaglerItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBeacon;
|
||||
import net.minecraft.block.BlockBush;
|
||||
|
@ -34,22 +38,31 @@ import net.minecraft.block.BlockTallGrass;
|
|||
import net.minecraft.block.BlockTripWireHook;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
|
@ -254,7 +267,8 @@ public class Blocks {
|
|||
public static BlockSlab double_stone_slab2;
|
||||
public static BlockSlab stone_slab2;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the Block in the blockRegistry with the specified
|
||||
* name.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,9 @@ package net.minecraft.item;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.hoosiertransfer.EaglerCustomBlock;
|
||||
import net.hoosiertransfer.EaglerItems;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
|
||||
|
||||
|
@ -20,6 +23,7 @@ import net.minecraft.block.BlockRedSandstone;
|
|||
import net.minecraft.block.BlockSand;
|
||||
import net.minecraft.block.BlockSandStone;
|
||||
import net.minecraft.block.BlockSilverfish;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.block.BlockStoneBrick;
|
||||
import net.minecraft.block.BlockWall;
|
||||
|
@ -46,22 +50,31 @@ import net.minecraft.util.StatCollector;
|
|||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
|
||||
* Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
|
@ -72,11 +85,13 @@ public class Item {
|
|||
protected static final EaglercraftUUID itemModifierUUID = EaglercraftUUID
|
||||
.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
private CreativeTabs tabToDisplayOn;
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* The RNG used by the Item subclasses.
|
||||
*/
|
||||
protected static EaglercraftRandom itemRand = new EaglercraftRandom();
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Maximum size of the stack.
|
||||
*/
|
||||
protected int maxStackSize = 64;
|
||||
|
@ -99,7 +114,8 @@ public class Item {
|
|||
return (Item) BLOCK_TO_ITEM.get(blockIn);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Tries to get an Item by it's name (e.g. minecraft:apple) or a
|
||||
* String representation of a numerical ID. If both fail, null
|
||||
* is returned.
|
||||
|
@ -117,7 +133,8 @@ public class Item {
|
|||
return item;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when an ItemStack with NBT data is read to potentially
|
||||
* that ItemStack's NBT data
|
||||
*/
|
||||
|
@ -130,7 +147,8 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when a Block is right-clicked with this Item
|
||||
*/
|
||||
public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, BlockPos var4, EnumFacing var5, float var6,
|
||||
|
@ -142,7 +160,8 @@ public class Item {
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called whenever this item is equipped and the right mouse
|
||||
* button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
|
@ -150,7 +169,8 @@ public class Item {
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when the player finishes using this Item (E.g.
|
||||
* finishes eating.). Not called when the player stops using the
|
||||
* Item before the action is complete.
|
||||
|
@ -159,7 +179,8 @@ public class Item {
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the maximum size of the stack for a specific item.
|
||||
* *Isn't this more a Set than a Get?*
|
||||
*/
|
||||
|
@ -167,7 +188,8 @@ public class Item {
|
|||
return this.maxStackSize;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Converts the given ItemStack damage value into a metadata
|
||||
* value to be placed in the world when this Item is placed as a
|
||||
* Block (mostly used with ItemBlocks).
|
||||
|
@ -185,14 +207,16 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the maximum damage an item can take.
|
||||
*/
|
||||
public int getMaxDamage() {
|
||||
return this.maxDamage;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* set max damage of an Item
|
||||
*/
|
||||
protected Item setMaxDamage(int maxDamageIn) {
|
||||
|
@ -204,7 +228,8 @@ public class Item {
|
|||
return this.maxDamage > 0 && !this.hasSubtypes;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Current implementations of this method in child classes do
|
||||
* not use the entry argument beside ev. They just raise the
|
||||
* damage on the stack.
|
||||
|
@ -213,7 +238,8 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when a Block is destroyed using this Item. Return true
|
||||
* to trigger the "Use Item" statistic.
|
||||
*/
|
||||
|
@ -221,14 +247,16 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Check whether this Item can harvest the given Block
|
||||
*/
|
||||
public boolean canHarvestBlock(Block var1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns true if the item can be used on the given entity,
|
||||
* e.g. shears on sheep.
|
||||
*/
|
||||
|
@ -236,7 +264,8 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets bFull3D to True and return the object.
|
||||
*/
|
||||
public Item setFull3D() {
|
||||
|
@ -244,14 +273,16 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns True is the item is renderer in full 3D when hold.
|
||||
*/
|
||||
public boolean isFull3D() {
|
||||
return this.bFull3D;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns true if this item should be rotated by 180 degrees
|
||||
* around the Y axis when being held in an entities hands.
|
||||
*/
|
||||
|
@ -259,7 +290,8 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets the unlocalized name of this item to the string passed
|
||||
* as the parameter, prefixed by "item."
|
||||
*/
|
||||
|
@ -268,7 +300,8 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Translates the unlocalized name of this item, but without the
|
||||
* .name suffix, so the translation fails and the unlocalized
|
||||
* name itself is returned.
|
||||
|
@ -278,14 +311,16 @@ public class Item {
|
|||
return s == null ? "" : StatCollector.translateToLocal(s);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the unlocalized name of this item.
|
||||
*/
|
||||
public String getUnlocalizedName() {
|
||||
return "item." + this.unlocalizedName;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns the unlocalized name of this item.
|
||||
*/
|
||||
public String getUnlocalizedName(ItemStack var1) {
|
||||
|
@ -297,7 +332,8 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* If this function returns true (or the item is damageable),
|
||||
* the ItemStack's NBT tag will be sent to the client.
|
||||
*/
|
||||
|
@ -309,7 +345,8 @@ public class Item {
|
|||
return this.containerItem;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* True if this Item has a container item (a.k.a. crafting
|
||||
* result)
|
||||
*/
|
||||
|
@ -321,7 +358,8 @@ public class Item {
|
|||
return 16777215;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called each tick as long the item is on a player inventory.
|
||||
* Uses by maps to check if is on a player hand and update it's
|
||||
* contents.
|
||||
|
@ -329,21 +367,24 @@ public class Item {
|
|||
public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when item is crafted/smelted. Used only by maps so
|
||||
* far.
|
||||
*/
|
||||
public void onCreated(ItemStack var1, World var2, EntityPlayer var3) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* false for all Items except sub-classes of ItemMapBase
|
||||
*/
|
||||
public boolean isMap() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns the action that specifies what animation to play when
|
||||
* the items is being used
|
||||
*/
|
||||
|
@ -351,21 +392,24 @@ public class Item {
|
|||
return EnumAction.NONE;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* How long it takes to use or consume an item
|
||||
*/
|
||||
public int getMaxItemUseDuration(ItemStack var1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Called when the player stops using an Item (stops holding the
|
||||
* right mouse button).
|
||||
*/
|
||||
public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) {
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Sets the string representing this item's effect on a potion
|
||||
* when used as an ingredient.
|
||||
*/
|
||||
|
@ -382,7 +426,8 @@ public class Item {
|
|||
return this.getPotionEffect(stack) != null;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* allows items to add custom lines of information to the
|
||||
* mouseover description
|
||||
*/
|
||||
|
@ -397,14 +442,16 @@ public class Item {
|
|||
return itemstack.isItemEnchanted();
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Return an item rarity from EnumRarity
|
||||
*/
|
||||
public EnumRarity getRarity(ItemStack itemstack) {
|
||||
return itemstack.isItemEnchanted() ? EnumRarity.RARE : EnumRarity.COMMON;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Checks isDamagable and if it cannot be stacked
|
||||
*/
|
||||
public boolean isItemTool(ItemStack var1) {
|
||||
|
@ -430,7 +477,8 @@ public class Item {
|
|||
return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false);
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Return the enchantability factor of the item, most of the
|
||||
* time is based on material.
|
||||
*/
|
||||
|
@ -438,7 +486,8 @@ public class Item {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns a list of items with the same ID, but different meta
|
||||
* (eg: dye returns 16 items)
|
||||
*/
|
||||
|
@ -446,14 +495,16 @@ public class Item {
|
|||
list.add(new ItemStack(item, 1, 0));
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* gets the CreativeTab this item is displayed on
|
||||
*/
|
||||
public CreativeTabs getCreativeTab() {
|
||||
return this.tabToDisplayOn;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* returns this;
|
||||
*/
|
||||
public Item setCreativeTab(CreativeTabs tab) {
|
||||
|
@ -461,7 +512,8 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Returns true if players can use this item to affect the world
|
||||
* (e.g. placing blocks, placing ender eyes in portal) when not
|
||||
* in creative
|
||||
|
@ -470,7 +522,8 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Return whether this item is repairable in an anvil.
|
||||
*/
|
||||
public boolean getIsRepairable(ItemStack var1, ItemStack var2) {
|
||||
|
@ -1033,24 +1086,27 @@ public class Item {
|
|||
registerItem(2257, (String) "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record"));
|
||||
registerItem(2258, (String) "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record"));
|
||||
registerItem(2259, (String) "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record"));
|
||||
registerItem(2260, (String) "record_far", (new ItemRecord("far")).setUnlocalizedName("record"));
|
||||
registerItem(2261, (String) "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record"));
|
||||
registerItem(2262, (String) "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record"));
|
||||
registerItem(2263, (String) "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record"));
|
||||
registerItem(2264, (String) "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record"));
|
||||
registerItem(2265, (String) "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record"));
|
||||
registerItem(2266, (String) "record_11", (new ItemRecord("11")).setUnlocalizedName("record"));
|
||||
registerItem(2267, (String) "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record"));
|
||||
for (EaglerCustomBlock block : EaglerItems.getEaglerCustomBlocks()) {
|
||||
if (!block.isSlab()) {
|
||||
registerItemBlock(block.getBlock(),
|
||||
(new ItemSlab(block.getBlock(), (BlockSlab) block.getBlock(), block.getSlabDouble()))
|
||||
.setUnlocalizedName(block.getBlock().getUnlocalizedName()));
|
||||
} else {
|
||||
registerItemBlock(block.getBlock());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Register the given Item as the ItemBlock for the given Block.
|
||||
*/
|
||||
private static void registerItemBlock(Block blockIn) {
|
||||
registerItemBlock(blockIn, new ItemBlock(blockIn));
|
||||
}
|
||||
|
||||
/**+
|
||||
/**
|
||||
* +
|
||||
* Register the given Item as the ItemBlock for the given Block.
|
||||
*/
|
||||
protected static void registerItemBlock(Block blockIn, Item itemIn) {
|
||||
|
@ -1067,6 +1123,11 @@ public class Item {
|
|||
itemRegistry.register(id, textualID, itemIn);
|
||||
}
|
||||
|
||||
private static void registerEaglerItem(int id, String textualID, Item itemIn) {
|
||||
EaglerItems.registerEaglerItem(textualID, itemIn);
|
||||
registerItem(id, textualID, itemIn);
|
||||
}
|
||||
|
||||
public static enum ToolMaterial {
|
||||
WOOD(0, 59, 2.0F, 0.0F, 15), STONE(1, 131, 4.0F, 1.0F, 5), IRON(2, 250, 6.0F, 2.0F, 14),
|
||||
EMERALD(3, 1561, 8.0F, 3.0F, 10), GOLD(0, 32, 12.0F, 0.0F, 22);
|
||||
|
|
|
@ -28,14 +28,21 @@ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2;
|
|||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
|
@ -49,15 +56,15 @@ public class PlatformFilesystem {
|
|||
filesystemDB = "_net_lax1dude_eaglercraft_v1_8_internal_PlatformFilesystem_1_8_8_" + dbName;
|
||||
DatabaseOpen dbOpen = AsyncHandlers.openDB(filesystemDB);
|
||||
|
||||
if(dbOpen.failedLocked) {
|
||||
if (dbOpen.failedLocked) {
|
||||
throw new FilesystemDatabaseLockedException(dbOpen.failedError);
|
||||
}
|
||||
|
||||
if(dbOpen.failedInit) {
|
||||
if (dbOpen.failedInit) {
|
||||
throw new FilesystemDatabaseInitializationException(dbOpen.failedError);
|
||||
}
|
||||
|
||||
if(dbOpen.database == null) {
|
||||
if (dbOpen.database == null) {
|
||||
throw new NullPointerException("IDBDatabase is null!");
|
||||
}
|
||||
|
||||
|
@ -82,15 +89,17 @@ public class PlatformFilesystem {
|
|||
|
||||
public static ByteBuffer eaglerRead(String pathName) {
|
||||
ArrayBuffer ar = AsyncHandlers.readWholeFile(database, pathName);
|
||||
if(ar == null) {
|
||||
if (ar == null) {
|
||||
return null;
|
||||
}
|
||||
return EaglerArrayBufferAllocator.wrapByteBufferTeaVM(Int8Array.create(ar));
|
||||
}
|
||||
|
||||
public static void eaglerWrite(String pathName, ByteBuffer data) {
|
||||
if(!AsyncHandlers.writeWholeFile(database, pathName, EaglerArrayBufferAllocator.getDataView8Unsigned(data).getBuffer()).bool) {
|
||||
throw new RuntimeException("Failed to write " + data.remaining() + " byte file to indexeddb table: " + pathName);
|
||||
if (!AsyncHandlers.writeWholeFile(database, pathName,
|
||||
EaglerArrayBufferAllocator.getDataView8Unsigned(data).getBuffer()).bool) {
|
||||
throw new RuntimeException(
|
||||
"Failed to write " + data.remaining() + " byte file to indexeddb table: " + pathName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,14 +109,15 @@ public class PlatformFilesystem {
|
|||
|
||||
public static boolean eaglerMove(String pathNameOld, String pathNameNew) {
|
||||
ArrayBuffer old = AsyncHandlers.readWholeFile(database, pathNameOld);
|
||||
return old != null && AsyncHandlers.writeWholeFile(database, pathNameNew, old).bool && AsyncHandlers.deleteFile(database, pathNameOld).bool;
|
||||
return old != null && AsyncHandlers.writeWholeFile(database, pathNameNew, old).bool
|
||||
&& AsyncHandlers.deleteFile(database, pathNameOld).bool;
|
||||
}
|
||||
|
||||
public static int eaglerCopy(String pathNameOld, String pathNameNew) {
|
||||
ArrayBuffer old = AsyncHandlers.readWholeFile(database, pathNameOld);
|
||||
if(old != null && AsyncHandlers.writeWholeFile(database, pathNameNew, old).bool) {
|
||||
if (old != null && AsyncHandlers.writeWholeFile(database, pathNameNew, old).bool) {
|
||||
return old.getByteLength();
|
||||
}else {
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +139,7 @@ public class PlatformFilesystem {
|
|||
|
||||
@Override
|
||||
public void next(String entry) {
|
||||
if(countSlashes(entry) == pathCount) {
|
||||
if (countSlashes(entry) == pathCount) {
|
||||
child.next(entry);
|
||||
}
|
||||
}
|
||||
|
@ -138,8 +148,8 @@ public class PlatformFilesystem {
|
|||
|
||||
private static int countSlashes(String str) {
|
||||
int j = 0;
|
||||
for(int i = 0, l = str.length(); i < l; ++i) {
|
||||
if(str.charAt(i) == '/') {
|
||||
for (int i = 0, l = str.length(); i < l; ++i) {
|
||||
if (str.charAt(i) == '/') {
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
@ -147,10 +157,11 @@ public class PlatformFilesystem {
|
|||
}
|
||||
|
||||
public static void eaglerIterate(String pathName, VFSFilenameIterator itr, boolean recursive) {
|
||||
if(recursive) {
|
||||
if (recursive) {
|
||||
AsyncHandlers.iterateFiles(database, pathName, false, itr);
|
||||
}else {
|
||||
AsyncHandlers.iterateFiles(database, pathName, false, new VFSFilenameIteratorNonRecursive(itr, countSlashes(pathName) + 1));
|
||||
} else {
|
||||
AsyncHandlers.iterateFiles(database, pathName, false,
|
||||
new VFSFilenameIteratorNonRecursive(itr, countSlashes(pathName) + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +192,7 @@ public class PlatformFilesystem {
|
|||
|
||||
private static void openDB(String name, final AsyncCallback<DatabaseOpen> cb) {
|
||||
IDBFactory i = createIDBFactory();
|
||||
if(i == null) {
|
||||
if (i == null) {
|
||||
cb.complete(new DatabaseOpen(false, false, "window.indexedDB was null or undefined", null));
|
||||
return;
|
||||
}
|
||||
|
@ -233,7 +244,8 @@ public class PlatformFilesystem {
|
|||
});
|
||||
}
|
||||
|
||||
@JSBody(params = { "obj" }, script = "return (typeof obj === \"undefined\") ? null : ((typeof obj.data === \"undefined\") ? null : obj.data);")
|
||||
@JSBody(params = {
|
||||
"obj" }, script = "return (typeof obj === \"undefined\") ? null : ((typeof obj.data === \"undefined\") ? null : obj.data);")
|
||||
protected static native ArrayBuffer readRow(JSObject obj);
|
||||
|
||||
@JSBody(params = { "obj" }, script = "return [obj];")
|
||||
|
@ -260,16 +272,20 @@ public class PlatformFilesystem {
|
|||
|
||||
}
|
||||
|
||||
@JSBody(params = { "k" }, script = "return ((typeof k) === \"string\") ? k : (((typeof k) === \"undefined\") ? null : (((typeof k[0]) === \"string\") ? k[0] : null));")
|
||||
@JSBody(params = {
|
||||
"k" }, script = "return ((typeof k) === \"string\") ? k : (((typeof k) === \"undefined\") ? null : (((typeof k[0]) === \"string\") ? k[0] : null));")
|
||||
private static native String readKey(JSObject k);
|
||||
|
||||
@JSBody(params = { "k" }, script = "return ((typeof k) === \"undefined\") ? null : (((typeof k.path) === \"undefined\") ? null : (((typeof k.path) === \"string\") ? k[0] : null));")
|
||||
@JSBody(params = {
|
||||
"k" }, script = "return ((typeof k) === \"undefined\") ? null : (((typeof k.path) === \"undefined\") ? null : (((typeof k.path) === \"string\") ? k[0] : null));")
|
||||
private static native String readRowKey(JSObject r);
|
||||
|
||||
@Async
|
||||
protected static native Integer iterateFiles(IDBDatabase db, final String prefix, boolean rw, final VFSFilenameIterator itr);
|
||||
protected static native Integer iterateFiles(IDBDatabase db, final String prefix, boolean rw,
|
||||
final VFSFilenameIterator itr);
|
||||
|
||||
private static void iterateFiles(IDBDatabase db, final String prefix, boolean rw, final VFSFilenameIterator itr, final AsyncCallback<Integer> cb) {
|
||||
private static void iterateFiles(IDBDatabase db, final String prefix, boolean rw, final VFSFilenameIterator itr,
|
||||
final AsyncCallback<Integer> cb) {
|
||||
IDBTransaction tx = db.transaction("filesystem", rw ? "readwrite" : "readonly");
|
||||
final IDBCursorRequest r = tx.objectStore("filesystem").openCursor();
|
||||
final int[] res = new int[1];
|
||||
|
@ -277,17 +293,17 @@ public class PlatformFilesystem {
|
|||
@Override
|
||||
public void handleEvent() {
|
||||
IDBCursor c = r.getResult();
|
||||
if(c == null || c.getKey() == null || c.getValue() == null) {
|
||||
if (c == null || c.getKey() == null || c.getValue() == null) {
|
||||
cb.complete(res[0]);
|
||||
return;
|
||||
}
|
||||
String k = readKey(c.getKey());
|
||||
if(k != null) {
|
||||
if(k.startsWith(prefix)) {
|
||||
if (k != null) {
|
||||
if (k.startsWith(prefix)) {
|
||||
int ci = res[0]++;
|
||||
try {
|
||||
itr.next(k);
|
||||
}catch(VFSIterator2.BreakLoop ex) {
|
||||
} catch (VFSIterator2.BreakLoop ex) {
|
||||
cb.complete(res[0]);
|
||||
return;
|
||||
}
|
||||
|
@ -330,7 +346,8 @@ public class PlatformFilesystem {
|
|||
@Async
|
||||
protected static native BooleanResult writeWholeFile(IDBDatabase db, String name, ArrayBuffer data);
|
||||
|
||||
private static void writeWholeFile(IDBDatabase db, String name, ArrayBuffer data, final AsyncCallback<BooleanResult> cb) {
|
||||
private static void writeWholeFile(IDBDatabase db, String name, ArrayBuffer data,
|
||||
final AsyncCallback<BooleanResult> cb) {
|
||||
IDBTransaction tx = db.transaction("filesystem", "readwrite");
|
||||
final IDBRequest r = tx.objectStore("filesystem").put(writeRow(name, data));
|
||||
|
||||
|
|
Loading…
Reference in New Issue