10000 Fix some bug by jihuayu · Pull Request #711 · gomint/gomint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix some bug #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions gomint-api/src/main/java/io/gomint/inventory/item/ItemFence.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.gomint.inventory.item;

import io.gomint.GoMint;
import io.gomint.world.block.data.LogType;

/**
* @author geNAZt
Expand All @@ -19,4 +20,17 @@ static ItemFence create( int amount ) {
return GoMint.instance().createItemStack( ItemFence.class, amount );
}

/**
* Set the type of fence
*
* @param type of fence
*/
ItemFence type(LogType type);

/**
* Get the type of this fence
*
* @return type of fence
*/
LogType type();
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.gomint.inventory.item;

import io.gomint.GoMint;
import io.gomint.world.block.data.LogType;

/**
* @author geNAZt
* @author jihuayu
* @version 1.0
* @stability 2
*/
Expand All @@ -18,5 +20,17 @@ public interface ItemFenceGate extends ItemStack<ItemFenceGate>, ItemBurnable {
static ItemFenceGate create( int amount ) {
return GoMint.instance().createItemStack( ItemFenceGate.class, amount );
}
/**
* Set the type of fence gate
*
* @param type of fence gate
*/
ItemFenceGate type(LogType type);

/**
* Get the type of this fence gate
*
* @return type of fence gate
*/
LogType type();
}

This file was deleted.

29 changes: 29 additions & 0 deletions gomint-api/src/main/java/io/gomint/inventory/item/ItemLeaves.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.gomint.inventory.item;

import io.gomint.GoMint;
import io.gomint.world.block.data.LogType;

/**
* @author geNAZt
Expand All @@ -19,4 +20,32 @@ static ItemLeaves create( int amount ) {
return GoMint.instance().createItemStack( ItemLeaves.class, amount );
}


/**
* Set the type of log
*
* @param type of log
*/
ItemLeaves type(LogType type);

/**
* Get the type of this log
*
* @return type of log
*/
LogType type();

// TODO: docs
ItemLeaves decay(boolean decay);

// TODO: docs
boolean decay();

// TODO: docs
ItemLeaves persistent(boolean persistent);

// TODO: docs
boolean persistent();


}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.gomint.inventory.item;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to ItemGlass since there is no "stained" and "non-stained" version.


import io.gomint.GoMint;
import io.gomint.world.block.data.GlassColor;

/**
* @author geNAZt
Expand All @@ -19,4 +20,18 @@ static ItemStainedGlass create( int amount ) {
return GoMint.instance().createItemStack( ItemStainedGlass.class, amount );
}


/**
* Get the color of this stained glass
*
* @return color of this stained glass
*/
GlassColor color();

/**
* Set the color of this stained glass
*
* @param color which this stained glass should have
*/
ItemStainedGlass color(GlassColor color);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.gomint.inventory.item;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to ItemGlassPane since there is no "stained" and "non-stained" version.


import io.gomint.GoMint;
import io.gomint.world.block.data.GlassColor;

/**
* @author geNAZt
Expand All @@ -19,4 +20,19 @@ static ItemStainedGlassPane create( int amount ) {
return GoMint.instance().createItemStack( ItemStainedGlassPane.class, amount );
}



/**
* Get the color of this glass pane
*
* @return color of this glass pane
*/
GlassColor color();

/**
* Set the color of this glass pane
*
* @param color which this glass pane should have
*/
ItemStainedGlassPane color(GlassColor color);
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.gomint.inventory.item;

import io.gomint.GoMint;
import io.gomint.world.block.data.LogType;

/**
* @author geNAZt
* @version 1.0
* @stability 2
*/
public interface ItemWoodenSlab extends ItemStack<ItemWoodenSlab>, ItemBurnable {
public interface ItemWoodenSlab extends ItemSlab<ItemWoodenSlab>, ItemBurnable {

/**
* Create a new item stack with given class and amount
Expand All @@ -19,4 +20,18 @@ static ItemWoodenSlab create( int amount ) {
return GoMint.instance().createItemStack( ItemWoodenSlab.class, amount );
}

/**
* Get the type of wooden this slab has
*
* @return type of wooden
*/
LogType type();

/**
* Set the type of wooden for this block
*
* @param type for this block
* @return block for chaining
*/
ItemWoodenSlab type(LogType type);
}
30 changes: 30 additions & 0 deletions gomint-api/src/main/java/io/gomint/world/block/BlockBarrel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2020 Gomint team
*
* This code is licensed under the BSD license found in the
* LICENSE file in the root directory of this source tree.
*/

package io.gomint.world.block;

import io.gomint.world.block.data.Facing;

/**
* @author jihuayu
* @version 1.0
*/
public interface BlockBarrel extends Block {


//TODO: docs
Facing face();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a BlockFacing abstraction interface. Please use it


//TODO: docs
BlockBarrel face(Facing value);

//TODO: docs
Boolean open();

//TODO: docs
BlockBarrel open(Boolean value);
}
6 changes: 6 additions & 0 deletions gomint-api/src/main/java/io/gomint/world/block/BlockBed.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package io.gomint.world.block;

import io.gomint.world.block.data.BlockColor;
import io.gomint.world.block.data.Direction;

/**
* @author geNAZt
Expand Down Expand Up @@ -53,4 +54,9 @@ public interface BlockBed extends Block {
*/
BlockBed head(boolean value);

//TODO: docs
Direction face();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a BlockFacing abstraction interface. Please use it


//TODO: docs
BlockBed face(Direction value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@

/**
* @author geNAZt
* @author jihuayu
* @version 1.0
* @stability 3
*/
public interface BlockComposter extends Block {
//TODO: docs
BlockComposter level(int level);
//TODO: docs
int level();
}
23 changes: 20 additions & 3 deletions gomint-api/src/main/java/io/gomint/world/block/BlockFenceGate.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* @author geNAZt
* @author jihuayu
* @version 1.0
* @stability 3
*/
Expand All @@ -21,25 +22,41 @@ public interface BlockFenceGate extends BlockDirection<BlockFenceGate> {
*/
BlockFenceGate toggle();


/**
* Set open for this fence gate
*
* @param open true if open, false if not
* @return block for chaining
*/
BlockFenceGate open(boolean open);

/**
* Check if this fence gate is open
*
* @return true if open, false if not
*/
boolean open();


//TODO: docs
BlockFenceGate inWall(boolean inWall);

//TODO: docs
boolean inWall();

/**
* Set the type of wood for this fence gate
* Set the type for this fence gate
*
* @param logType type of wood
* @return block for chaining
*/
BlockFenceGate type(LogType logType);

/**
* Get the type of wood from which this fence gate has been made
* Get the type of fence gate from which this fence gate has been made
*
* @return type of wood
* @return type of fence gate
*/
LogType type();

Expand Down
16 changes: 0 additions & 16 deletions gomint-api/src/main/java/io/gomint/world/block/BlockGlassPane.java

This file was deleted.

12 changes: 12 additions & 0 deletions gomint-api/src/main/java/io/gomint/world/block/BlockLeaves.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,16 @@ public interface BlockLeaves extends Block {
*/
LogType type();


// TODO: docs
BlockLeaves decay(boolean decay);

// TODO: docs
boolean decay();

// TODO: docs
BlockLeaves persistent(boolean persistent);

// TODO: docs
boolean persistent();
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package io.gomint.world.block;

import io.gomint.world.block.data.BlockColor;
import io.gomint.world.block.data.GlassColor;

/**
* @author geNAZt
Expand All @@ -21,13 +21,13 @@ public interface BlockStainedGlass extends Block {
*
* @return color of this block
*/
BlockColor color();
GlassColor color();

/**
* Set the color of this block
*
* @param color which this block should be
*/
BlockStainedGlass color(BlockColor color );
BlockStainedGlass color(GlassColor color );

}
Loading
0