-
Notifications
You must be signed in to change notification settings - Fork 147
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
redstone #941
redstone #941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far, keep up the good work!
case "ButtonType": | ||
return "uint64(" + s + ".Uint8())", 6 | ||
case "PressurePlateType": | ||
return "uint64(" + s + ".Uint8())", 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, you can reduce this to 2 for buttons and 3 for pressure plates
return | ||
} | ||
|
||
h.Powered = powered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If !powered you should reset the cooldowns as well as short circuiting the Tick() method like mentioned on discord
"time" | ||
) | ||
|
||
// IronTrapDoor is a solid, transparent block that can be used as an openable 1×1 barrier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention it's redstone functionality similarly to iron doors
|
||
// NeighbourUpdateTick ... | ||
func (p PressurePlate) NeighbourUpdateTick(pos, _ cube.Pos, w *world.World) { | ||
if d, ok := w.Block(pos.Side(cube.FaceDown)).(LightDiffuser); ok && d.LightDiffusionLevel() == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check for support supposed to be different to the one below in UseOnBlock()
import "github.com/df-mc/dragonfly/server/item" | ||
|
||
// RedstoneOre is a common ore. | ||
type RedstoneOre struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the server needs to handle the state of redstone becoming active when interacted with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing lit state
|
||
// Uint8 ... | ||
func (b ButtonType) Uint8() uint8 { | ||
return b.wood.Uint8() | uint8(b.button)<<4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not ideal. With the current order, as we get more wood variants, this will need to be updated, which might not be obvious to whoever is doing that.
if b.Type == StoneButton() || b.Type == PolishedBlackstoneButton() { | ||
return item.FuelInfo{} | ||
} | ||
return newFuelInfo(time.Second * 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be checking if type == Wood() if future types were to be added, although Wood currently takes a parameter...
delay := time.Millisecond * 1500 | ||
if b.Type == StoneButton() || b.Type == PolishedBlackstoneButton() { | ||
delay = time.Millisecond * 1000 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably better in ButtonType
return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierIron.HarvestLevel | ||
}, pickaxeEffective, silkTouchOneOf(RedstoneWire{}, c)).withXPDropRange(1, 5) | ||
if c.Type == DeepslateOre() { | ||
i = i.withBlastResistance(9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed for redstone ore
func (c RedstoneOre) BreakInfo() BreakInfo { | ||
i := newBreakInfo(c.Type.Hardness(), func(t item.Tool) bool { | ||
return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierIron.HarvestLevel | ||
}, pickaxeEffective, silkTouchOneOf(RedstoneWire{}, c)).withXPDropRange(1, 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop needs fixing
import "github.com/df-mc/dragonfly/server/item" | ||
|
||
// RedstoneOre is a common ore. | ||
type RedstoneOre struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing lit state
This pr is built from #739
the goal for this pr is to add the base for redstone.
this pr adds
levers
buttons
pressure plates
redstone wire
redstone torch
redstone block
redstone lamp
redstone ore
iron door
iron trap door
hopper locking